14

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.

tereško
  • 56,151
  • 24
  • 92
  • 147
bansal kapil
  • 355
  • 1
  • 2
  • 12
  • '' should echo out the correct version of CI. if it doesn't something might be wrong with your CI installation - specially if you comment several times that you have no system folder! I would try to re-install CI from scratch. – Vickel Dec 23 '16 at 17:16
  • Does this answer your question? [Which version of CodeIgniter am I currently using?](https://stackoverflow.com/questions/2196799/which-version-of-codeigniter-am-i-currently-using) – Adam P. Nov 14 '20 at 14:13

8 Answers8

25

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

define('CI_VERSION', '3.0.6');
Hikmat Sijapati
  • 6,557
  • 1
  • 7
  • 18
7

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');

RASEL RANA
  • 1,966
  • 1
  • 12
  • 16
6

In the root folder:

cat system/core/CodeIgniter.php | grep CI_VERSION

paulc
  • 325
  • 3
  • 9
4

check the file system/core/CodeIgniter.php

Linu S
  • 81
  • 10
3

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!

Deep Kakkar
  • 4,538
  • 4
  • 26
  • 58
3

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

Rafiqul Islam
  • 729
  • 9
  • 12
2

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...

Naga
  • 2,160
  • 3
  • 14
  • 21
0

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

user1283182
  • 121
  • 3