How to install Codeignetor centos 7?

Codeignetor is a PHP framework used to build a web application that is used widely by the developers over the world. Before you install Codeignetor make sure the following requirements are already installed.

  • Webserver apache or nginx
  • PHP 5.6
  • MySQL
  • Composer

Once you confirm the above component on your server. Proceed to install Codeignetor with the following steps.

  1. Set SELinx Status to disable.

    # SELINUX=disabled
  2. Let us create MySQL Database for codeignetor.

    # create database mycode_db;
    grant all privileges on mycodeusr.* to [email protected]'localhost' identified by 'your_password';
    flush privileges;
    exit
  3. Now, we will install Composer Package Manager.

    # curl -sS https://getcomposer.org/installer | php
    
    # mv composer.phar /usr/local/bin/composer
    # chmod +x /usr/local/bin/composer
    exit
  4. We will install Codeigniter. Go to the root directory html.

    # cd /var/www/html/
  5. Clone CodeIgniter from its git repository.

    # git clone https://github.com/bcit-ci/CodeIgniter.git


  6. We will install required dependencies running composer.

    # composer install
    
  7. Provide file ownership of files to apache user.

    # chown -R apache:apache /var/www/html/
    
  8. We will configure the base url by editing config.php file.

    # vi /var/www/html/application/config/config.php
    
  9. locate the below line.

    $config['base_url'] = '';
    
  10. Modify this line by adding your application url in the quotes.

    $config['base_url'] = 'http://173.248.174.102';
    
  11. To configure Codeignetor Database connection setting, edit the following file with your favorite text editor:

    # vi /var/www/html/application/config/database.php
    
  12. Locate below path.

    $db['default'] = array(
            'dsn'   => '',
            'hostname' => 'localhost',
            'username' => '',
            'password' => '',
            'database' => '',
            'dbdriver' => 'mysqli',
    
    Change it to:

    $db['default'] = array(
            'dsn'   => '',
            'hostname' => 'localhost',
            'username' => 'mycode_db',
            'password' => 'your-db-user-password',
            'database' => 'mycodeusr',
            'dbdriver' => 'mysqli',
    
  13. Once you are done with the changes, save this file. Access the url which you have added earlier in base_url and verify that codeignator is working.
  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

How to enable sFTP in a Linux VPS?

The SSH File Transfer Protocol (SFTP), also known as the Secure File Transfer Protocol, enables...

How to Install A-AST Linux Malware Detect Interface in cPanel/WHM?

You can scan your cPanel VPS and dedicated server against malware and keep your environment clean...

How to Stop and Disable ClamAV Service from CentOS?

We all know that ClamAV scanner is a pretty heavy on CPU-Memory resources, and it should be...

How to reset/renew cPanel/WHM Self-signed Certificate?

You might be receiving an email with subject like “The SSL certificate for “[service like exim,...

How to install IonCube Loader on CentOS 7 Manually?

Ioncube is a PHP module which protects the PHP application's source code from being viewed from...