如何保留 PHP 5.5 但使用 5.4(不推荐使用 CodeIgniter)

2022-01-24 00:00:00 debian php mysql codeigniter

我有一个运行 ISPConfig 3 的专用服务器.它属于 Debian 7(官方 PHP 5.4).我已将其升级到 PHP 5.5.

I have a dedicated server running with ISPConfig 3. It came under Debian 7 (officially PHP 5.4). I have upgraded it to PHP 5.5.

但是,我没有意识到CodeIgniter需要mysql驱动才能运行......因此,我的网站不再工作了.

However, I didn't realize that CodeIgniter needs the mysql driver to run... Therefore, my website doesn't work anymore.

所以要么我找到一种仅在网站上使用 PHP 5.4 的方法(而不影响在 PHP 5.5 下运行的其他人),要么我找到一种方法来升级"CodeIgniter,使其不再使用已弃用的 mysql 扩展.

So either I find a way to use PHP 5.4 only on a website (without affecting the others running under PHP 5.5) or I find a way to "upgrade" CodeIgniter so it doesn't use the deprecated mysql extension anymore.

推荐答案

相信你可以对config/database.php

改变

$db['default']['dbdriver'] = "mysql";

到:

$db['default']['dbdriver'] = "mysqli";

由于 CI 使用数据库抽象层,这应该是透明的.

As CI uses a database abstraction layer, this should be transarent.

相关文章