How to Deploy CodeIgniter Project on Paas.id
![How to Deploy CodeIgniter Project on Paas.id](/content/images/size/w2000/2022/10/Codeigniter.png)
Introduction
CodeIgniter is a free and open-source web application framework written in PHP.
In this guide, we will learn about deploying a CodeIgniter project on Paas.id.
Prerequisites
- Have installed a web server on Paas.id
- Have created an empty web application on Paas.id
- Know how to manage files using file manager on Paas.id
- Know how to manage databases using phpMyAdmin on Paas.id
Step 1 - Upload CodeIgniter Project via File Manager
In this guide, we will deploy a to-do list application. The application are documented in the URL below.
Firstly, navigate to the empty web application directory on the file manager.
![](https://blog.paas.id/content/images/2022/07/image-190.png)
Open the public folder and make sure the folder is empty by deleting all files.
![](https://blog.paas.id/content/images/2022/07/image-191.png)
Upload the CodeIgniter project file or you can upload from URL by using the URL below.
https://github.com/joshtmags/code_igniter-todolist/archive/refs/heads/master.zip
![](https://blog.paas.id/content/images/2022/07/image-192.png)
View the file and extract them to the current directory.
![](https://blog.paas.id/content/images/2022/07/image-193.png)
![](https://blog.paas.id/content/images/2022/07/image-194.png)
Now, move all files in the "code_igniter-todolist-master" folder to the current public folder.
![](https://blog.paas.id/content/images/2022/07/image-195.png)
To make it clean, delete the archive file and the "code_igniter-todolist-master" folder. Now the files should be like the image below.
![](https://blog.paas.id/content/images/2022/07/image-196.png)
Step 2 - Create & Import Database via phpMyAdmin
Create a database namely "todolist" via the phpMyAdmin.
![](https://blog.paas.id/content/images/2022/07/image-198.png)
Open the database and click the "Import" menu.
![](https://blog.paas.id/content/images/2022/07/image-200.png)
Choose the database file and click the "Go" button. You should see the success notification like the image below.
![](https://blog.paas.id/content/images/2022/07/image-199.png)
Step 3 - Configure the Application
Firstly, you need to set the new base_url
config by editing this file application/config/config.php
. The base_url
value should be your application URL, in this guide is http://167.71.220.112/first-ci/
. Don't forget to save the file.
![](https://blog.paas.id/content/images/2022/07/image-201.png)
Next, you need to set the new database config by editing this file application/config/database.php
.
![](https://blog.paas.id/content/images/2022/07/image-204.png)
The hostname
, username
, and password
value should match the database credentials provided on the Paas.id server database page.
![](https://blog.paas.id/content/images/2022/07/image-205.png)
The database
value should be "todolist". The database config script should be like the image below.
![](https://blog.paas.id/content/images/2022/07/image-206.png)
Don't forget to save the file.
Notes: if you want to remove index.php from any application's URL you need to set the index_page
config to blank in application/config/config.php
. After that, you should follow the guide from CodeIgniter's official documentation that we provide below.
![](https://codeigniter.com/user_guide/_static/ci-logo-text.png)
Step 4 - Test the Application
Now visit your application and the page should be like the image below.
![](https://blog.paas.id/content/images/2022/07/image-207.png)
Voila, the CodeIgniter project is deployed and it's works!
Furthermore, you can follow the guide below if you want to add a domain to your application.
![](https://static.ghost.org/v4.0.0/images/publication-cover.jpg)
Don't forget to change the base_url
config in application/config/config.php