Find Which CodeIgniter 4 Version Using?

Share this Article
Reading Time: 2 minutes

In CodeIgniter 3, we have a constant variable to see CodeIgniter version i.e CI_VERSION. But in CodeIgniter 4, we have some different approach.

Learn CodeIgniter 4 Basics in a quick tour, Click here.

Note*: For this article, CodeIgniter v4.1 setup has been installed. May be when you are seeing, version will be updated. CodeIgniter 4.x still is in development mode.

Let’s see from Installation.

Download & Install CodeIgniter 4 Setup

We need to download & install CodeIgniter 4 application setup to system.

To set application we have multiple options to proceed.

Here are the following ways to download and install CodeIgniter 4 –

  • Manual Download
  • Composer Installation
  • Clone Github repository of CodeIgniter 4

Complete introduction of CodeIgniter 4 basics – Click here to go. After going through this article you can easily download & install setup.

Here is the command to install via composer –

$ composer create-project codeigniter4/appstarter codeigniter-4

Assuming you have successfully installed application into your local system.

Turn Development Mode On

When we install CodeIgniter 4, we have env file at root. To use the environment variables means using variables at global scope we need to do env to .env

Open project in terminal

$ cp env .env

Above command will create a copy of env file to .env file. Now we are ready to use environment variables.

CodeIgniter starts up in production mode by default. Let’s do it in development mode. So that while working if we get any error then error will show up.

# CI_ENVIRONMENT = production

 // Do it to 
CI_ENVIRONMENT = development

Now application is in development mode.

Find CodeIgniter Version?

We have two options to see where we can find it. First either by going through the located file (Core File) and second we can print the version by a codeigniter constant.

Version Located File

Need to go installed setup and find this path & file – /vendor/codeigniter4/framework/system/CodeIgniter.php

Inside this CodeIgniter.php file, you should see we have a class named with CodeIgniter and a constant in that class as const CI_VERSION = ‘4.1.1’;

This 4.1.1 in my case, in your case it may be different due to new released versions.

Print CodeIgniter Version in application

Inside this we need to use same CodeIgniter class by the help of it’s namespace. Have a look, we have created a controller to print the value.


namespace App\Controllers;

class Home extends BaseController
    public function showVersion()
        echo \CodeIgniter\CodeIgniter::CI_VERSION;

We hope this article helped you to learn about to find CodeIgniter 4 application version in a very detailed way.

If you liked this article, then please subscribe to our YouTube Channel for PHP & it’s framework, WordPress, Node Js video tutorials. You can also find us on Twitter and Facebook.

Find More on CodeIgniter 4 here

1 thought on “Find Which CodeIgniter 4 Version Using?”

  1. Thank you for some other excellent article. The place else could anybody
    get that type of information in such an ideal way of writing?
    I have a presentation subsequent week, and I am at the look
    for such information.

Comments are closed.