- WinCE Security...
- xdebug配置说明
- VC++ 获取文件的创建、修...
- ASP进度条
- 简单代理服务器C代码实现(S...
- 程序设计竞赛试题选(02)
- 如何在ASP程序中打印Acc...
- UTF-8和16进制区间
- ASP实用技巧:强制刷新和判...
- 运行中程序删除自己的方法
- asp提高首页性能的一个技巧
- [J2EE]J2EE 应用服务器技术
- VB变量命名规范
- C语言常见错误小结
- (摘自网络)如何在IIS中调...
PHP Fatal error: Call to undefined function mysql_connect() in XXX.php
centos系统,安装好了apache和mysql数据库了之后,打开网站显示空白,然后进入/etc/httpd/logs查看日志文件,在error_log文件里面查看到以下错误:
[Thu Aug 10 10:40:43 2017] [error] [client 192.168.31.180] PHP Fatal error: Call to undefined function mysql_connect() in /wwwroot/lyx_5ht6cv/web/inc/config.php on line 11
[Thu Aug 10 10:40:45 2017] [error] [client 192.168.31.180] PHP Fatal error: Call to undefined function mysql_connect() in /wwwroot/lyx_5ht6cv/web/inc/config.php on line 11
[Thu Aug 10 10:40:45 2017] [error] [client 192.168.31.180] PHP Fatal error: Call to undefined function mysql_connect() in /wwwroot/lyx_5ht6cv/web/inc/config.php on line 11
[Thu Aug 10 10:40:46 2017] [error] [client 192.168.31.180] PHP Fatal error: Call to undefined function mysql_connect() in /wwwroot/lyx_5ht6cv/web/inc/config.php on line 11
[Thu Aug 10 10:40:53 2017] [error] [client 192.168.31.180] PHP Fatal error: Call to undefined function mysql_connect() in /wwwroot/lyx_5ht6cv/web/1.php on line 10
[Thu Aug 10 10:40:56 2017] [error] [client 192.168.31.180] PHP Fatal error: Call to undefined function mysql_connect() in /wwwroot/lyx_5ht6cv/web/1.php on line 10
[Thu Aug 10 10:40:56 2017] [error] [client 192.168.31.180] PHP Fatal error: Call to undefined function mysql_connect() in /wwwroot/lyx_5ht6cv/web/1.php on line 10
然后运行phpinfo();,发现是没有安装有mysql组件,导致无法连接mysql数据库,使用yum安装一下mysql组件,一切恢复正常。
# yum install php-mysql
当然,您还可以一起安装其它的PHP组件.
#yum
install
php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc