且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

CodeIgniter无法实例化控制器类

更新时间:2023-01-15 11:22:12

好的,这个问题的根源是使用mysql_connect连接到数据库时出错。由于某种原因,它不会产生任何错误,也不会产生 or die( error ...);的任何错误;这是因为我们在服务器上使用的是php 5.4,并且似乎不再支持mysql_connect ,除非您已安装mysqlnd,解决方案是将数据库驱动程序切换为CodeIgniter幸运地具有该驱动程序的'mysqli',然后使用以下命令安装php5-mysql:apt-get install php5-mysql
希望这会有所帮助其他人。

Okay, the root of this problem was an error connecting to the database using mysql_connect. For some reason, it would not produce any error whatsoever, nor would "or die("error..."); do anything. This was because we were using php 5.4 on the server, and mysql_connect does not seem to be supported anymore, unless you have mysqlnd installed. The solution was to switch our database driver to 'mysqli', which CodeIgniter luckily has a driver for, and then install php5-mysql with: apt-get install php5-mysql Hope this helps anyone else.