user2417624 user2417624 - 1 year ago 580
PHP Question

CodeIgniter 3.1.0 to 3.1.2 upgrade miserable fail

I have an application that has CodeIgniter version 3.1.0 and I am trying to "upgrade" to 3.1.2 (latest version)

I have no custom files in the System folder. I had renamed the system folder (for security reasons) and that change is in my index.php
As soon as I switch on the old system folder, application works just fine.

The error that I get is:

PHP Parse error: syntax error, unexpected T_CONST in C:\\prj\\www\\nbo\\systemXXYYZZ\\core\\CodeIgniter.php on line 58

Line 58 of the CodeIgniter.php is:

LINE 37:defined('BASEPATH') OR exit('No direct script access allowed');
LINE 58: const CI_VERSION = '3.1.2';

My php version is 5.2.4, apache version is 2.2.6

Answer Source

const won't work on php version 5.2.x.

The latest version of codeigniter is supported only on php 5.3.7+, so I highly advice you to upgrade your PHP version.

You could downgrade your project to codeigniter 3.0.5, which is the last version that supports php 5.2.x, but it's not recommended.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download