修改php.ini后PHP cURL未加载

7
为了在PHP中启用cURL,我要取消注释此行。
extension=php_curl.dll

但是,在重新启动Apache时,cURL没有加载。即使重新启动计算机也是如此。我在Windows XP上安装了带有AppServer的PHP 5.2.1。
请帮助我启用cURL。任何形式的帮助都将不胜感激。

你的PHP/ext目录中是否有php_curl.dll文件? - matino
是的,我在我的PHP/ext文件夹中有php_curl.dll。 - Shahid Karimi
3个回答

6

我升级了PHP 5.6.4版本后,curl突然不能用了。虽然我的php.ini和扩展文件都没有问题。

我通过在控制面板->系统->高级系统设置->环境变量中将C:\php (我的php文件夹)添加到系统变量的Path路径解决了这个问题。


但这可能与libeay32路径问题有关。它们位于/php/文件夹中,因此环境变量可以解决此问题。因此,您可以选择移动文件或使路径“全局化”。 - François Breton

5

试试这个:

  1. Download the copy of the win32 PHP (not the installer one) from php.net (whichever php version that you want running on your webserver).

  2. Then from the dll folder, copy these two files: libeay32.dll and ssleay32.dll to your Windows/System32 (whichever Windows you have).

  3. And then from the extensions folder: get your php_curl.dll and place it under your /php/extensions folder.

  4. Check your php.ini to ensure it's referring to the correct extension folder, for example:

    extension_dir = "./extensions/"
    

    And uncomment your extension to php_curl.dll for example:

    extension=php_curl.dll
    
  5. Restart Apache

谢谢。希望它对你有用。


1
+1 救了我无尽的调试时间。对我来说,一开始并没有起作用,但我注意到在apache bin目录中有相同的文件,所以我只是将它们从那里删除,重新启动了我的服务器,然后就可以了 :) - Dany Khalife
现在使用PHP 7,我无法加载curl,不幸的是这些说明没有帮助。 - Simon East

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接