Skip to main content

Installing CodeIgniter on Windows, Linux, and macOS

This tutorial provides detailed instructions on how to install CodeIgniter on different operating systems: Windows, Linux, and macOS. We will cover installation using XAMPP or WAMP on Windows, and for Linux and macOS, we will use alternative software based on availability. The table of contents below contains links for easy navigation.

Table of Contents

Installing CodeIgniter on Windows

There are multiple ways to install CodeIgniter on Windows. In this section, we will cover two common methods: using XAMPP and using WAMP.

Using XAMPP

  1. Download and install XAMPP from the official website (https://www.apachefriends.org) following the instructions provided.
  2. Start XAMPP and ensure that the Apache and MySQL services are running.
  3. Download the latest stable version of CodeIgniter from the official website (https://codeigniter.com) and save the ZIP file to a location on your computer.
  4. Extract the ZIP file and move the extracted CodeIgniter(Project folder Name) folder to the htdocs directory within the XAMPP installation directory.
    • For XAMPP: The htdocs directory is typically located at C:\xampp\htdocs.
  5. Open a web browser and visit http://localhost/codeigniter to see the CodeIgniter welcome screen.

Using WAMP

  1. Download and install WAMP from the official website (http://www.wampserver.com) following the instructions provided.
  2. Launch WAMP and ensure that the Apache and MySQL services are running.
  3. Download the latest stable version of CodeIgniter from the official website (https://codeigniter.com) and save the ZIP file to a location on your computer.
  4. Extract the ZIP file and move the extracted CodeIgniter(name of project folder) folder to the www directory within the WAMP installation directory.
    • For WAMP : The www directory is usually located at C:\wamp\www.
  5. Open a web browser and visit http://localhost/codeigniter to see the CodeIgniter welcome screen.

Installing CodeIgniter on Linux

On Linux, we will use the LAMP stack, which consists of Linux, Apache, MySQL, and PHP, to install CodeIgniter.

Using LAMP

  1. Install the Apache web server, MySQL, and PHP on your Linux distribution using the package manager. The exact commands may vary depending on your distribution. For example, on Ubuntu, you can run:

    sudo apt update
    sudo apt install apache2 mysql-server php
  2. Start the Apache and MySQL services. The commands to start the services may vary based on your distribution. For example, on Ubuntu, you can run:

    sudo systemctl start apache2
    sudo systemctl start mysql
  3. Download the latest stable version of CodeIgniter from the official website (https://codeigniter.com) and save the ZIP file to a location on your computer.

  4. Extract the ZIP file and move the extracted CodeIgniter(name of project folder) folder to the document root directory of the Apache web server, usually located at /var/www/html.

    • For LAMP : The htdocs directory is commonly found at /var/www/html.
  5. Open a web browser and visit http://localhost/codeigniter to see the CodeIgniter welcome screen.

Installing CodeIgniter on macOS

On macOS, we will use the MAMP stack, which consists of macOS, Apache, MySQL, and PHP, to install CodeIgniter.

Using MAMP

  1. Download and install MAMP from the official website (https://www.mamp.info) following the instructions provided.
  2. Launch MAMP and start the Apache and MySQL services.
  3. Download the latest stable version of CodeIgniter from the official website (https://codeigniter.com) and save the ZIP file to a location on your computer.
  4. Extract the ZIP file and move the extracted CodeIgniter(name of project folder) folder to the htdocs directory within the MAMP installation directory.
  5. Open a web browser and visit http://localhost:8888/codeigniter to see the CodeIgniter welcome screen.

Now, We have successfully installed CodeIgniter on your Windows, Linux, or macOS machine. We can now begin developing our CodeIgniter applications. Remember to refer to the CodeIgniter documentation for further guidance on using the framework.