php无法连接mysql数据库的正确解决方法
时间:2021-01-27 10:40:42|栏目:PHP代码|点击: 次
即使连接Mysql的语句正确,php也无法连接mysql数据库,出现如下图所示的结果:

首先是在Apache服务器的conf/httpd.conf下的任意位置都没有:PHPIniDir "php压缩目录"这一项。
如"C:/php-5.4.43-Win32-VC9-x86是php的压缩目录,应该有PHPIniDir "C:/php-5.4.43-Win32-VC9-x86"

之后,需要把php压缩目录,与php压缩目录/ext添加到环境变量Path值中。
此时重启服务器解决。

栏 目:PHP代码
本文地址:http://www.codeinn.net/misctech/52171.html






