CodeIgniter compatibility with PHP version?

﹥>﹥吖頭↗ 提交于 2019-12-17 16:41:51

问题


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.


回答1:


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.




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/41037434/codeigniter-compatibility-with-php-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!