简体   繁体   中英

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.

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.

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:

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

CI supports php 5.x versions. If want to upgrade your CI project, please Visit https://www.codeigniter.com/userguide3/installation/upgrade_300.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM