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文件的,至于为什么还无法载入,不得而知.

记录备忘.

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值