2.8.4.6.1. Install CodeIgniter

Below are two methods for installing the CodeIgniter framework's core script package and its dependent libraries. These instructions are based on the official documentation.

  1. Download the latest version of the CodeIgniter framework from the official repository.
  2. Using the file manager or an FTP client, upload the archive to your hosting account and place it in the root directory of the desired site.
  3. Extract the archive of the framework into the project directory where you plan to install it.
  1. By default, the hosting environment uses PHP 5.6. Since the framework requires PHP 7.2 or higher, you need to update the paths in the $PATH variable by running the following command:
    export PATH=/usr/local/php72/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
  2. Execute the command:
    composer create-project codeigniter4/appstarter ~/path/to/project/directory
  1. Change PHP version for the site to 7.2 or higher (official requirements).
  2. Edit the .htaccess file in the public directory:
    1. Change the line:
      Options All -Indexes

      To:

      Options -Indexes
    2. Change the line:
      Options +FollowSymlinks

      To:

      Options +SymLinksIfOwnerMatch

If the site root directory is not www (CodeIgniter project files are typically located in the public directory), you can specify the desired root directory in site settings or add the following directives to the .htaccess file:

# www/.htaccess

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule ((?s).*) public/$1 [L]
</IfModule>
Content