2.8.4.6.1. Installing CodeIgniter
Procedure
Here are two ways to install the base script package of the CodeIgniter framework and dependent libraries. The instruction is based on official documentation.
- Download the latest CodeIgniter framework from official repository.
- Unpack the archive framework to the project directory where you plan to install it.
- 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
$PATH
by running the command:export PATH=/usr/local/php72/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
- Run the command:
composer create-project codeigniter4/appstarter ~/way/to/catalog/theproject
After installation
- Change PHP version for a site on 7.2 or higher (official requirements).
- Edit the file
.htaccess
in the catalogpublic
:- Change the line:
Options All -Indexes
Per line:
Options -Indexes
- Change the line:
Options +FollowSymlinks
Per line:
Options +SymLinksIfOwnerMatch
Root directory
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>