未定义的函数mysql_connect() [英] Undefined function mysql_connect()

查看:115
本文介绍了未定义的函数mysql_connect()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经运行了aptitude install php5-mysql(并重新启动了MySQL/Apache 2),但是仍然出现此错误:

I have ran aptitude install php5-mysql (and restarted MySQL/Apache 2), but I am still getting this error:

致命错误:在第21行的/home/validate.php中调用未定义的函数mysql_connect()

Fatal error: Call to undefined function mysql_connect() in /home/validate.php on line 21

phpinfo()表示/etc/php5/apache2/conf.d/pdo_mysql.ini文件已被解析.

phpinfo() says the /etc/php5/apache2/conf.d/pdo_mysql.ini file has been parsed.

推荐答案

好吧,这是您的机会!看来 PDO 已经准备就绪;改用它.

Well, this is your chance! It looks like PDO is ready; use that instead.

尝试检查是否正在加载PHP MySQL扩展模块:

Try checking to see if the PHP MySQL extension module is being loaded:

<?php
    phpinfo();
?>

如果不存在,请将以下内容添加到php.ini文件:

If it's not there, add the following to the php.ini file:

extension=php_mysql.dll

这篇关于未定义的函数mysql_connect()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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