Blog Details

How to Install CodeIgniter 4: Step-by-Step Guide (2025)

How to Install CodeIgniter 4: Step-by-Step Guide (2025)

How to Install CodeIgniter 4: Step-by-Step Guide (2025)

In 2025, PHP remains a relevant and widely used programming language. CodeIgniter continues to be one of the most popular web development frameworks. In this tutorial, we will guide you through the installation and setup of a CodeIgniter 4 application step by step.

This is the simplest and most beginner-friendly explanation for installing and running CodeIgniter. I’ll guide you from scratch to a fully set-up environment, based on real experience. CodeIgniter is lightweight, fast, and perfect for small to mid-size projects. It also opens up excellent job opportunities for beginners.

So, let’s begin this exciting journey with CodeIgniter 4 installation!

Table of Contents

  1. CodeIgniter 4 Installation & Environment Setup
  2. Method 1: Install CodeIgniter 4 Manually
  3. Method 2: Install CodeIgniter 4 via Composer
    1. Step 1: Download Composer Installer
    2. Step 2: Install Composer (Windows Installer)
    3. Step 3: Installation Process
      1. Install Mode
      2. Developer Mode (Optional)
      3. PHP Path Setup
      4. Proxy Settings
      5. Ready to Install
    4. Step 4: Wait for Installation
    5. Step 5: Verify Composer Installation
    6. Run This Composer Command to Install CodeIgniter 4

CodeIgniter 4 Installation & Environment Setup

There are two ways to install CodeIgniter 4: manually or via Composer. The Composer method is recommended for keeping the framework updated.

Method 1: Install CodeIgniter 4 Manually

Go to codeigniter.com and download the latest version.

Extract it into your web server directory (e.g., htdocs).

Start the server:

php spark serve

Then open:

http://localhost:8080

Method 2: Install CodeIgniter 4 via Composer

Step 1: Download Composer Installer

  1. Visit getcomposer.org
  2. Click on “Getting Started” or go directly to getcomposer.org/download
  3. Download the Composer-Setup.exe file under Windows Installer.

Step 2: Install Composer (Windows Installer)

  1. Run the downloaded installer
  2. Follow the setup instructions

Step 3: Installation Process

Install Mode

  • Select “Install for all users” and click Next.

Developer Mode (Optional)

  • You can leave it unchecked. Click Next.

PHP Path Setup

  • Set PHP executable path: C:\xampp\php\php.exe
  • Click Next

Proxy Settings

  • Leave as default. Click Next.

Ready to Install

  • Click Install

Step 4: Wait for Installation

Wait until Composer installs completely. Then click Finish.

Step 5: Verify Composer Installation

composer --version

If installed correctly, you will see:

Composer version 2.8.8 2025-04-04 16:56:46
PHP version 8.0.30 (C:\xampp\php\php.exe)

Run This Composer Command to Install CodeIgniter 4

  1. Open terminal and navigate to your web server directory:
cd C:\xampp\htdocs
  1. Run this command:
composer create-project codeigniter4/appstarter my_ci4_project
  1. Navigate to the project:
cd my_ci4_project
  1. Run the local server:
php spark serve
  1. Visit http://localhost:8080 in your browser

CodeIgniter welcome page

Congratulations! You’ve successfully installed CodeIgniter 4.

FAQ

What is CodeIgniter 4?

It’s a lightweight PHP framework for building web applications quickly with minimal setup and configuration.

What PHP version is required?

PHP 7.4 or higher. PHP 8.0+ is recommended.

What does php spark serve do?

It runs the built-in development server so you can test your app locally at http://localhost:8080.

Where should I put the project using XAMPP?

Place it in C:\xampp\htdocs\ (Windows) or /Applications/XAMPP/htdocs/ (macOS).

What if Composer says PHP executable not found?

Ensure the PHP path is correct during installation or add it manually to the system environment variables.

Community Feedback

0 Comments

No comments yet. Be the first to comment!

Post Comment

Your email address will not be published. Required fields are marked *