Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CodeIgniter compatibility with PHP version?

I am using CodeIgniter 2.2.6 with PHP 5.5 and it works fine. Now I want to upgrade PHP to version 5.6.6 my question is, is CodeIgniter compatible with PHP 5.6.6?

I can't upgrade CodeIgniter to a new version because I have many models based on Version 2.2.6.

like image 944
jamal Avatar asked Dec 08 '16 10:12

jamal


People also ask

Is CodeIgniter PHP framework?

CodeIgniter is a powerful PHP framework with a very small footprint, built for developers who need a simple and elegant toolkit to create full-featured web applications. Why CodeIgniter?

Is CodeIgniter 4 is a stable version?

CodeIgniter 3 and CodeIgniter 4 are the most stable of the other versions: The CodeIgniter framework provides you with an out-of-the-box database and basic operations libraries, such as sending emails, file uploading, session management, and so on.

How long will CodeIgniter 3 be supported?

As mentioned above version 3 should be good for a minimum of two years after the release of version 4, but it's been around for a while and is so widely used I suspect you'll be able to maintain and support it for many years to come.


2 Answers

Codeigniter 2.2x IS COMPATIBLE with PHP7.1+.

You only need to remember:

  1. Models/classes and so on are case-sensitive and have to start from capital letter
  2. The same with names of files in application folder
  3. There are problems with mysql (very old, not used now driver) so you have to use mysqli driver (but it is already implemented in CI2, check if you're not using it already)
  4. if you have session table sometimes you'll have to truncate this table, clear cache and populate it again.
  5. Check compatibility of software in third_party folder if you have problems - CI is not responsible for that issues.

In my case everything is working smoothly with the newest version of bootstrap & jQuery installed. However, I'm not using hooks, advanced functions and so on.

NOTE, that in most cases you can force server to use older php version using .htaccess and AddHandler command:

AddHandler application/x-httpd-php56 .php

This is last version of PHP before PHP7.

And last but not least - of course I don't recommend to use this very old version of CI, however in my opinions - in my cases - there is no sense to migrate from CI2x to CI3, in 2018 it is better to wait for CI4 and then migrate.

like image 135
Vilq Avatar answered Sep 19 '22 18:09

Vilq


The Server Requirements page in the user guide says that CodeIngiter 2 requires "PHP version 5.1.6 or newer".

Note that PHP 5.6 will stop receiving active support in less than a month, so you might want to go right to version 7. PHP 5.6 should receive security patches until the end of 2018.

I can't upgrade CodeIgniter to a new version because I have many models based on Version 2.2.6.

Note also that CodeIgniter 2 is no longer supported:

the current version (2.2.6) came out in October, 2015.

CodeIgniter 2 has reached its end-of-life for support and updates, as of October 31, 2015. No further updates are planned.

We encourage you to upgrade to CodeIgniter 3.x!

There is an upgrade path from version 2.2 to version 3.1, which I encourage you to explore:

  • First, read Upgrading from 2.2.x to 3.0.x
  • Then, read the steps for performing minor upgrades

This probably isn't as hard as you think, and with the security implications I believe it's worthwhile.

like image 37
Chris Avatar answered Sep 21 '22 18:09

Chris