
How to install and Configure the CodeIgniter Framework
There are a few steps we need to apply in order to install and Configure the CodeIgniter Framework for Cloud server configuration for Codeigniter.
Note: We are considering the installation of codeigniter on Centos 7.
- Install LAMP
- Install PHP5
- Install DB
- Configure DB
- Install phpMyAdmin
- Install Configure
- Configure Codeigniter

Update the OS
- yum update -y
To Install LAMP onCentOS-7
- Install Apache with basic config
- yum install httpd
- Use the following commands to manage Apache daemon
- apachectl configtest| graceful
- Configure the Firewall
- Restart the Firewall
- 1. systemctl restart firewalld
- 2. firewall-cmd –add-service=http
- 3. firewall-cmd –permanent –add-service=http
- 4. firewall-cmd –reload
- Restart the Firewall
Note: To allow https, repeat the same step again for sevice https
- Now, restart the httpd service
- systemctl restart httpd
- To check the status
- systemctl status httpd
- Now, open browser and type the IP, You will see Apache website
To Install PHP5 support for Apache
- To get the full available PHP modules, use this command
- yum search php
- For a normal LAMP server, install the below modules
- yum install php php-mysql php-pdo php-gd php-mbstring
Here,
php-pdo.x86_64 : A database access abstraction module for PHP applications
php-gd.x86_64 : A module for PHP applications for using the gd graphics library
php-mbstring.x86_64 : A module for PHP applications which need multi-byte string handling
Install and Configure DB[Here we will use MariaDB]
- yum install mariadb-server mariadb -y
- Start database daemon and use mysql_secure_installation script
- systemctl start mariadb
- Configure the Maria DB
- mysql_secure_installation
- To test database functionality login to MariaDB using its root account and exit using quit statement.
mysql -u root -p MariaDB > SHOW VARIABLES; MariaDB > quit |
Install PHP-MyAdmin
- Install the required package for the phpMyAdmin
- yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm
- Install PhpMyAdmin.
- yum install phpMyAdmin -y
- Configure PhpMyAdmin to allow connections from remote hosts by editing phpmyadmin.conf file
- vi /etc/httpd/conf.d/phpMyAdmin.conf
- Change 127.0.0.1 to below

- systemctl restart httpd
Note: If you don`t do the above configuration right, when you access the phpMyAdmin url, you may get error message like 1.Forbidden You don’t have permission to access /phpmyadmin/on this server Job for httpd.service 2. Failed because the control process exited with error code.If you get any of these error, ensure to check the phpMyAdmin.conf file and look for Require IP and Allow from |
- Now, open the browser and type the http://IP/phpmyadmin
- root/server_password
- Note: If you want to change the URL from http://IP/phpmyadmin to http://IP/some_other_name
- vi /etc/httpd/conf.d/phpMyAdmin.conf
- Comment out the default two Alias lines and write your own alias there.
#Alias /phpMyAdmin /usr/share/phpMyAdmin |
#Alias /phpmyadmin /usr/share/phpMyAdmin |
Alias /some_other_name /usr/share/phpMyAdmin |
- Restart the httpd service.
- systemctl restart httpd
Install Codeigniter on the CentOS LAMP
- Disable SELINUX
Check the current status
sestatus
To disable the SeLinux
vi /etc/sysconfig/selinux
Edit with this
SELINUX=disabled
Codeigniter database configuration
mysql -u root -p
create database code_db;
CREATE USER codeignitersuser@localhost IDENTIFIED BY ‘password’;
GRANT ALL PRIVILEGES ON code_db.* TO codeigniteruser@localhost;
FLUSH PRIVILEGES;
Exit
- Install composer package manager
If you wish to install CodeIgniter dependencies, you will need composer. It is easy to install with the following commands:
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer
- Install Codeigniter Frameowrk
cd /var/www/html/
yum install -y git
git clone https://github.com/bcit-ci/CodeIgniter.git .
Install the required dependencies
composer install
Change the ownership of the root files to the user apache
chown -R apache:apache /var/www/html/
- Configure Base URL for Codeigniter, by updating the variables
vi /var/www/html/application/config/config.php
Change $config[‘base_url’] = ”; to $config[‘base_url’] = ‘http://IP’;
- Configure the DB
vi /var/www/html/application/config/database.php
Edit these info
$db[‘default’] = array( ‘dsn’ => ”, ‘hostname’ => ‘localhost’, ‘username’ => ‘code_db’, ‘password’ => ‘password’, ‘database’ => ‘code_db’, ‘dbdriver’ => ‘mysqli’, |
These are the steps to be followed to install and Configure the CodeIgniter Framework on the Cloud Server.

Contact LIA Infraservices the leading Mobile App Development Company in Chennai, Web Development, DevOps, Digital Marketing, Graphics & UI/UX Design, Cloud Migration Services.