ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
yum安装的php和mysql通信需要相应的驱动。 ~~~ yum install php53-mysql #centos 5 yum install php-mysql #centos 6,7 yum install php-mysqlnd #centos 7 ~~~ 测试文件 ~~~ <?php $connection=mysql_connect('localhost','root','123456'); if ($connection) echo "sucess..."; else echo "die.."; ?> ~~~ >[danger] 在centos 6 httpd以worker模型进行测试,出现如下错误。 ~~~ [Thu Aug 25 16:02:07 2016] [error] [client 192.168.1.102] PHP Fatal error: Call to undefined function mysql_connect() in /www/d/index.php on line 2 报错:Cannot load /etc/httpd/modules/libphp5-zts.so into server ~~~ 分析:此处http是worker模型,需要libphp5-zts.so模块,因此需要安装此模块 ~~~ # yum install php-zts /usr/lib64/httpd/modules/libphp5-zts.so ~~~