如何修复此错误“ PHP致命错误:调用未定义的函数mysql_query()在蛋糕烘烤控制台 [英] how to fix this error " PHP Fatal error: Call to undefined function mysql_query() " in cake bake console

查看:1173
本文介绍了如何修复此错误“ PHP致命错误:调用未定义的函数mysql_query()在蛋糕烘烤控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在许多地方看到这个错误,但确切的情况。
我在运行蛋糕烘焙控制台时遇到了这个错误,刚刚选择C控制器,然后选择默认数据库配置



我在Ubuntu 10.10 Virtualbox
我使用xampp - 并通过命令apt-get install cakephp



安装了cakephp这里是错误

 使用数据库配置:(默认/测试)
[默认]
PHP致命错误:调用未定义的函数mysql_query()在/usr/share/php/cake/libs/model/datasources/dbo/dbo_mysql.php在线588

致命错误:调用未定义的函数mysql_query()在/usr/share/php/cake/libs/model/datasources/dbo/dbo_mysql.php第588行

$你的问题很可能是某些Linux发行版对Apache PHP和PHP-CLI有不同的php.ini,似乎你的PHP- CLI(baker将使用的)没有启用mysql_ *函数。



要修复,你需要找到PHP CLI的php.ini并取消注释包含mysql_ * lib的行。应该是像extension = mysql.so。要找到php.ini的位置,请在命令行上运行 php -r'phpinfo();'并滚动到顶部以查看php.ini的位置。


I've seen this error in many places but the exact case. I got this error while running the cake bake console, exactly after choosing C " controller " then choosing the default database config

i'm on Ubuntu 10.10 through Virtualbox i'm using xampp - and installed the cakephp through the command apt-get install cakephp

here is the error

Use Database Config: (default/test) 
[default] > 
PHP Fatal error:  Call to undefined function mysql_query() in /usr/share/php/cake/libs/model/datasources/dbo/dbo_mysql.php on line 588

Fatal error: Call to undefined function mysql_query() in /usr/share/php/cake/libs/model/datasources/dbo/dbo_mysql.php on line 588

解决方案

Your issue is more than likely that some Linux distros have different php.ini's for Apache PHP and and PHP-CLI, it appears that your PHP-CLI (which cake baker will use) doesn't have the mysql_* functions enabled.

To fix, you'll need to locate the php.ini for the PHP CLI and uncomment the line which includes the mysql_* lib. should be something like "extension=mysql.so". To find the location of php.ini, run php -r 'phpinfo();' on the command line and scroll to the top to see the location of php.ini.

这篇关于如何修复此错误“ PHP致命错误:调用未定义的函数mysql_query()在蛋糕烘烤控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆