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

来源:互联网 发布:王牌特工知乐txt下载 编辑:程序博客网 时间:2024/05/18 01:35

测试环境: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

原创粉丝点击