Server Requirements
Relevant source files
The following files were used as context for generating this wiki page:
This document outlines the server requirements for running the CodeIgniter 4 framework. Adhering to these requirements is essential for the proper functioning, security, and performance of any application built with CodeIgniter. The framework is designed to be light and fast, but it relies on a specific set of PHP versions and extensions to enable its full feature set.
Sources: README.md:3, intro/requirements.html:120-121
PHP Version
CodeIgniter 4 requires a specific version of PHP to be installed on the server.
| Component | Required Version |
|---|---|
| PHP | 7.4 or higher |
Attempting to run the framework on a version lower than 7.4 will result in failure.
Sources: intro/requirements.html:124
PHP Extensions
CodeIgniter 4 relies on several PHP extensions being enabled in your php.ini configuration. Some are mandatory for the framework to run, while others are optional and enable specific functionalities like image manipulation or caching.
Required Extensions
The following extensions must be enabled for CodeIgniter 4 to work correctly. Most web hosting environments have these enabled by default.
The diagram below shows the core PHP extensions required by the framework.
| Extension | Description |
|---|---|
| php-intl | Required for internationalization features. A common installation issue is this extension not being enabled, which can cause errors. |
| php-mbstring | Provides multibyte string functions, essential for working with UTF-8 encoded strings. |
| php-json | Used for all JSON-related operations within the framework. It is typically enabled by default in modern PHP builds. |
| php-libcurl | Required if you plan to use the CURLRequest class for making HTTP requests to external services. |
Sources: intro/requirements.html:130-136, installation/troubleshooting.html:123-124, installation/installing_composer.html:148
Optional Extensions
These extensions are not required for the framework to run but are necessary for using certain classes or features.
| Extension | Description |
|---|---|
| php-gd | Required for most image manipulation methods available in the Image Manipulation library. |
| php-imagick | An alternative to php-gd for image manipulation, providing access to ImageMagick library features. |
| php-memcached | Required to use the Memcached Caching Handler. |
| php-redis | Required to use the Redis Caching Handler. |
| php-apcu | Required to use the APCu Caching Handler. |
Sources: intro/requirements.html:141-146
Supported Databases
CodeIgniter 4 ships with database drivers for a variety of platforms. A mysqlnd driver is required for MySQL/MariaDB databases.
The following diagram illustrates the databases officially supported by CodeIgniter 4's built-in drivers.
A summary of the supported databases and their required drivers is provided below.
| Database | Driver Required |
|---|---|
| MySQL | mysqlnd PHP extension is required. Version 5.1 or newer. |
| PostgreSQL | pg PHP extension is required. Version 9.6 or newer. |
| SQLite3 | sqlite3 PHP extension is required. Version 3.9 or newer. |
| Microsoft SQL Server | sqlsrv PHP extension is required. Version 2012 or newer. |
| Oracle (via OCI8) | oci8 PHP extension is required. Version 12.1 or newer. |
Sources: intro/requirements.html:151-160
Local Development Server
For local development and testing, CodeIgniter includes a built-in development server that can be launched using a spark command. This eliminates the need to configure a full web server like Apache or Nginx for development purposes.
Starting the Server
To start the local development server, navigate to the root of your project directory in the terminal and execute the following command:
php spark serve
This will launch the server, and by default, the application will be accessible at http://localhost:8080.
The process of launching the local server is shown below.
Sources: installation/running.html:121-127
Troubleshooting
A common issue related to server requirements is the intl extension not being enabled. If you encounter errors like IntlDateFormatter::format: datefmt_format: no such file or directory, it indicates that the extension is missing or not configured correctly. You must install and enable php-intl to resolve this.