2.8.4.6.1. Installing CodeIgniter

Here are two ways to install the base script package of the CodeIgniter framework and dependent libraries. The instruction is based on official documentation.

  1. Download the latest CodeIgniter framework from official repository.
  2. Through filemanager or FTPclient upload the archive to hosting in root directory desired site.
  3. Unpack the archive framework to the project directory where you plan to install it.
  1. By default, the SSH environment on the hosting uses PHP 5.6. According to the requirements of the framework, a version of at least 7.2 is required, so override the paths in the variable $PATHby running the command:
    export PATH=/usr/local/php72/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
  2. Run the command:
    composer create-project codeigniter4/appstarter ~/way/to/catalog/theproject
  1. Change PHP version for a site on 7.2 or higher (official requirements).
  2. Edit the file .htaccess in the catalog public:
    1. Change the line:
      Options All -Indexes

      Per line:

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

      Per line:

      Options +SymLinksIfOwnerMatch

If the root directory of the site is different from www (usually the project files on CodeIgniter are located in the directory public), then you can set the desired root directory in site settings or write the following directives in the file .htaccess:

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