PHP 加载 curl.dll 扩展失败的原因和解决方法

测试环境:PHP 5.2.5 + WINDOWS SERVER 2003 SP2 + IIS6.0

今天安装 Drupal 的 SimpleTest 模块的时候,提示失败,说我的PHP没有安装 curl 库,查看phpinfo确实没有找到“curl”配置信息,开始以为 curl 和mysqli一样只是个扩展而已(因为看到PHP/EXT 文件包里有个php_curl.dll文件),只是在php.ini里面打开了 php_curl.dll 扩展的加载,结果 iisreset 重启 IIS 后问题依旧,curl 还是没有加载成功,就纳了闷了,回去查PHP手册(不去论坛问了,问了也是让查手册,弄不好还挨顿骂。。。。)

嘿嘿,终于找到原因了,看下手册里的安装说明:

安装

To use PHP's cURL support you must also compile PHP --with-curl[=DIR] where DIR is the location of the directory containing the lib and include directories. In the "include" directory there should be a folder named "curl" which should contain the easy.h and curl.h files. There should be a file named libcurl.a located in the "lib" directory. Beginning with PHP 4.3.0 you can configure PHP to use cURL for URL streams --with-curlwrappers.

Note to Win32 Users: In order to enable this module on a Windows environment, libeay32.dll and ssleay32.dll must be present in your PATH. (作者注:嘿嘿,windows用户要拷贝PHP/目录下的libeay32.dll和ssleay32.dll到windows目录或windows/system32目录下,只要是环境变量里Path变量里的路径就OK,你把PHP路径放到Path变量里也应该可以,我没做测试,因为win2003里面PHP的php.ini在IIS里只认得WINDOWS目录,所以我把PHP.INI和这两个文件都放到C:/WINDOWS下了,测试通过

 

You don't need libcurl.dll from the cURL site.

问题解决,截图留念。。。
curl lib in phpinfo

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值