`
tedeyang
  • 浏览: 317871 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

php加载mysql模块时出现的无法载入dll问题和解决

阅读更多



今天试用e2php,失败.
发现一段apache 2.2错误日志:

PHP Warning:  PHP Startup: Unable to load dynamic library '../php/ext\\php_mysql.dll' - \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3\r\n in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '../php/ext\\php_mysqli.dll' - \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3\r\n in Unknown on line 0

后面的错误信息看不出是什么,不过凭经验知道应该是mysql模块载入时出错.
因为其他模块可以载入,所以可知extension_dir是正确是,问题大概是这两个dll依赖于其他环境.
google一下,发现此信息: http://www.corephp.co.uk/archive ... ons-on-Windows.html ,这个页面讲述了php中各个模块的配置相关,
其中有一段:

"

php_mysql.dll

php_mysqli.dll

Both require libmysql.dll in your PHP root directory. If this doesn't exist, copy it from the MySQL/bin directory assuming you have MySQL installed locally. If not then download it, install it, get the DLL you require, then you can remove MySQL again if you want. You could also add the MySQL/bin directory to your Path environment variable if you so wished.

"

说明需要mysql的bin/libmysql.dll文件,于是我设置了一下我的PATH变量,重启,无效!
怎么回事?
我接着在apache目录下写一个测试文件: index.php,内容: <? echo phpinfo()?>,
发现php中显示的path没有发生变化,原来php用的是系统变量里的PATH,重新修改PATH后,重启apache,成功!
其实在php目录下是有这个libmysql.dll文件的,至于为什么还无法载入,不得而知.

记录备忘.

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics