apache找不到mysql.dll

在windows xp下安装了apache和php, php能够正常工作。但不能用php连接mysql, 查看apache的error.log发现了:PHP Warning: PHP Startup: Unable to load dynamic library ‘C:/software/php-5.2/ext/php_mysql.dll’ – The specified module could not be found.\r\n in Unknown on line 0

赶紧查看配置文件吧:—– php.ini
extension_dir = “C:/software/php-5.2/ext/”
extension=php_mysql.dll
在C:/software/php-5.2/ext/明明有php_mysql.dll这个文件, 可它就是说找不到这个文件, 好奇怪,只好求助于谷哥吧
终于找到啦:
原来php_mysql.dll依赖于libmysql.dll这个文件, 而libmysql.dll又在C:/software/php-5.2/目录下, 而之前并没有把C:/software/php-5.2/加到环境变量里, 也没有把libmysql.dll放到C:\WINDOWS\system32目录下, 系统根本找不到php_mysql.dll, 所以出镜啦
解决方法:
1. 把libmysql.dll放到C:\WINDOWS\system32下。
2. 把PHP[我的就是:C:/software/php-5.2/]的路径加到环境变量里。 [这个没有测过, 因为本人用第一种方法试了,成功了, 所以就偷懒没试这个了]

One thought on “apache找不到mysql.dll”

  1. Hello my family member! I want to say that this article is amazing, nice written and come with approximately all vital infos. I’d like to see extra posts like this.

Comments are closed.