'how to check version of codeigniter framework?

I recently setup a old Codeigniter framework on my xampp.But i don't know the version of this framework. I use the code

<?php echo CI_VERSION; ?> 

but its give me error

Notice: Use of undefined constant CI_VERSION - assumed 'CI_VERSION' in /opt/lampp/htdocs/projectname/views/v_header.php on line 57
CI_VERSION

Please guide me, I am new in Codeigniter.



Solution 1:[1]

See in system/core/CodeIgniter.php and there is a constant like this..

define('CI_VERSION', '3.0.6');

Solution 2:[2]

You can check it two ways. one is to

<?php echo CI_VERSION; ?>

Another way is go to your system/core/CodeIgniter.php path and then check define('CI_VERSION', '2.1.4');

Solution 3:[3]

In the root folder:

cat system/core/CodeIgniter.php | grep CI_VERSION

Solution 4:[4]

check the file system/core/CodeIgniter.php

Solution 5:[5]

Method 1:

Please access the file

System >> Core >> Codeigniter.php

 /**
  * CodeIgniter Version
  *
  * @var    string
  *
  */
  define('CI_VERSION', '3.0.0');

Method 2: In index.php or any other view file write the following code of php as follows:

 <?php
   echo CI_VERSION;
 ?>

CI_VERSION is build in constant in codeigniter, which contains value of version.

Thank you!

Solution 6:[6]

Try This:<?php echo CI_VERSION; ?> // echoes something like 3.1.6

Solution 7:[7]

Which means you are not properly configure your codeigniter project / system folder. System folder is not necessary to be placed in project root. you can place anywhere and configure the correct system path[something like $system_path = '../system';] in the index.php(project root) properly. It should work...

Solution 8:[8]

For CodeIgniter 4, the CI_VERSION is defined in system\CodeIgniter.php

Solution 9:[9]

Just use this simple code to check for Codeigniter version

<?= CodeIgniter\CodeIgniter::CI_VERSION ?>

Solution 10:[10]

If you are running CodeIgniter 4, the CodeIgniter 3 style

<?php echo CI_VERSION; ?>

would not work out and you would get the error - Use of undefined constant CI_VERSION

As @user1283182 has pointed out, the exact version can be found in system/CodeIgniter.php (see const CI_VERSION)

or enter the below code in one of your views

<?= CodeIgniter\CodeIgniter::CI_VERSION ?>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Hikmat Sijapati
Solution 2 RASEL RANA
Solution 3 pableiros
Solution 4 Linu S
Solution 5 Deep Kakkar
Solution 6 Rafiqul Islam
Solution 7 Naga
Solution 8 user1283182
Solution 9 Yunat Amos
Solution 10