CI 4 Installation

Share this Article

In older versions of CodeIgniter, installation process includes either we can download a zipped folder or simply need to do clone of github repository.

But in CodeIgniter 4.x we now find the installation process also includes composer based concept. It means we have total methods available to download equals to 3.

Methods of Installation

  • Download & Setup via a zipped folder from official link – Manual Method.
  • CodeIgniter 4.x Github repository clone.
  • Install by Composer

Download & Setup via a zipped folder – Manual Install

Inside this installation process, simply we need to download a zipped folder from official website of may be from github repository.

If we redirect to the official website given above – we can see download option at landing page as well as we can find inside the Menu – Download.

At Landing Page we should see –

When you click to the Download Menu at top header, you will be redirected to the download page. at that page you should see the download link as –

You need to download “zipped” folder and move to to local system. That’s it.


CodeIgniter 4.x Github repository

This method provides the option to do clone via github repository. In official documentation a github link is given. After clicking on that link we will be redirected into this github repository page.

At the github page, you should see –

If we click on Download Zip button, it simply downloads CodeIgniter 4 setup. But when we go through the Clone with HTTPS method, we need to run the command as –

$ git clone https://github.com/codeigniter4/framework.git

This terminal command will clones a framework folder into your given path. When you run above command, will get messages at command prompt or terminal –

Output

Cloning into 'framework'…
remote: Enumerating objects: 3017, done.
remote: Total 3017 (delta 0), reused 0 (delta 0), pack-reused 3017
Receiving objects: 100% (3017/3017), 1.36 MiB | 1.17 MiB/s, done.
Resolving deltas: 100% (2056/2056), done.
Checking connectivity… done.

Installation via Composer

Composer is a tool which helps PHP to manage it’s dependencies. So in this case of download process, first you need to verify that your system has composer installed or not. If not, you need to install it first.

To install composer, follow the instructions given at official websiteComposer Official Document.

Now, let’s assume system has composer already installed. To verify the installation at system, run the command at terminal – $ composer . You should see the welcome page of composer at terminal i.e welcome command panel.

CodeIgniter 4 installation is also very simple in this case as well. Back to terminal after checking that everything is ok with the composer installation. Command to use to install codeigniter setup –

$ composer create-project codeigniter4/appstarter my-app

After running the above command, it will start the installation process. It creates my-app project folder at your given path. This is user define project folder name, you can name it your own.

If suppose, you don’t pass the my-app with name command then by default it will create project setup with the name called appstarter.


Run Application

To start application server via spark CLI, type the following command.

$ php spark serve

Application server has been started at http://localhost:8080

It will start a development server for application.

Learn Web Development Courses @ $4 only.
Web Development Courses @ $4