Below is a step-by-step guide to setting up a CodeIgniter environment, focusing on CodeIgniter 4 (recommended for new projects).
Make sure your system has:
PHP 7.4 or higher (PHP 8.x supported)
Extensions enabled:
intl
mbstring
json
mysqlnd (for MySQL)
Composer (recommended)
Web server: Apache / Nginx / XAMPP / WAMP / Laragon
Then move into the project:
Download from the official CodeIgniter website
Extract the files
Rename the folder (e.g., myproject)
Rename .env file:
Open .env and set:
Edit:
Edit .env:
Use CodeIgniter’s built-in server:
Visit:
You should see the CodeIgniter welcome page ????
Make sure these folders are writable:
In .env:
Errors will now be displayed clearly.
Enable mod_rewrite and use .htaccess:
Create a test controller:
Edit:
Visit:
| Issue | Solution |
|---|---|
| Blank page | Check PHP version |
| 404 error | Base URL or routes misconfigured |
| Composer not found | Install Composer & add to PATH |
Take quizzes related to this topic and see where you stand!
Start Quiz Now