Home >Backend Development >PHP Tutorial >PHP连接MySQL报错:Fatal error: Call to undefined function mysql_connect()之解决方法

PHP连接MySQL报错:Fatal error: Call to undefined function mysql_connect()之解决方法

WBOY
WBOYOriginal
2016-06-23 14:37:421728browse

 新安装了一台windows2008R2,配置php_mysql_Apache环境,系统是64位的,遇到很多麻烦。

都下载了64位的压缩包才解决。最后php连接mysql错误,Fatal error: Call to undefined function mysql_connect() 

百度,google也找了很久,最后也解决了。详细:其他php.in和apache的httpd.conf配置不用说了,

关键点1.   把php中的libmysql.dll文件复制到Apache的bin里面,一测试,居然好了。

关键点2:配合Apache2时最好使用PHPIniDir,即在apache2/conf/httpd.conf文件中加入:

# configure the path to php.ini   "c:/php"是php.ini所在的文件路径
PHPIniDir " C:/php"

NTFS上记得给服务器开PHP.ini的读权限。

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn