Manage cookies that are used for advertising, such as ad personalization, remarketing, and ad effectiveness analysis.
2.8.4.6.1. Install CodeIgniter
Procedure
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.
- Download the latest version of the CodeIgniter framework from the official repository.
- 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.
- Extract the archive of the framework into the project directory where you plan to install it.
- 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
$PATHvariable by running the following command:export PATH=/usr/local/php72/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin - Execute the command:
composer create-project codeigniter4/appstarter ~/path/to/project/directory
After installation
- Change PHP version for the site to 7.2 or higher (official requirements).
- Edit the
.htaccessfile in thepublicdirectory:- Change the line:
Options All -IndexesTo:
Options -Indexes - Change the line:
Options +FollowSymlinksTo:
Options +SymLinksIfOwnerMatch
Root directory
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>