简体   繁体   English

PHP cURL不起作用-Windows 7 64位上的WAMP

[英]PHP cURL not working - WAMP on Windows 7 64 bit

I got my WAMP installed on my windows 7 64bit. 我在Windows 7 64bit上安装了WAMP cURL is not working, but still I got it enabled from the WAMP tray. cURL不起作用,但是我仍然从WAMP托盘启用了它。

I have also uncommented extension=php_curl.dll in php.ini for both the PHP and Apache folder. 对于PHP和Apache文件夹,我也extension=php_curl.dllphp.ini extension=php_curl.dll进行注释。

Windows give me an error message, Windows给我一条错误消息,

PHP Startup: unable to load dynamic library 'c:/wamp/bin/php/php5.4.3/ext/php_curl.dll' - the application has failed to start because its side-by-side configuration is incorrect. PHP启动:无法加载动态库'c:/wamp/bin/php/php5.4.3/ext/php_curl.dll'-应用程序无法启动,因为其并行配置不正确。 Please see the application event log or use the command-lin sxstrace.exe tool for more detail." 请参阅应用程序事件日志或使用command-lin sxstrace.exe工具获取更多详细信息。”

How can I fix this problem? 我该如何解决这个问题?

Go to http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/ and download the cURL version that corresponds to your PHP version under "Fixed curl extensions:" . 转到http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/并下载与您的PHP对应的cURL版本“固定的curl扩展名:”下的版本。

So if you have PHP 5.3.13, download "php_curl-5.3.13-VC9-x64.zip". 因此,如果您具有PHP 5.3.13,请下载“ php_curl-5.3.13-VC9-x64.zip”。 Try the "VC" version first. 首先尝试“ VC”版本。 Then replace the php_curl.dll in ext folder. 然后替换ext文件夹中的php_curl.dll。 This worked for me. 这对我有用。

I had the same exact issue. 我有同样的问题。 After trying almost everything and digging on Stack Overflow, I finally found the reason. 在尝试了几乎所有内容并深入研究Stack Overflow之后,我终于找到了原因。 Try downloading "fixed curl extension" separately from PHP 5.4.3 and PHP 5.3.13 x64 (64 bit) for Windows . 尝试从Windows的PHP 5.4.3和PHP 5.3.13 x64(64位)分别下载“ fixed curl extension”。

I've downloaded "php_curl-5.4.3-VC9-x64", and it worked for me. 我下载了“ php_curl-5.4.3-VC9-x64”,它对我有用。 I hope it helps. 希望对您有所帮助。

Works for me: 为我工作:

  • Go to this link 转到此链接
  • Download *php_curl-5.4.3-VC9-x64.zip* under "Fixed curl extensions:" 在“固定的curl扩展:”下下载* php_curl-5.4.3-VC9-x64.zip *
  • Replace the php_curl.dll file in the ext folder. 替换ext文件夹中的php_curl.dll文件。

This worked for me. 这对我有用。

I have struggled a lot with this myself.. In the end, PHP version 5.3.1 with Apache 2.2.9 worked... 我为此付出了很多努力。.最后,带有Apache 2.2.9的PHP版本5.3.1起作用了...

I was getting the consistent error of missing php5.dll. 我收到丢失php5.dll的一致错误。 For this, I renamed all the old php.ini files which are not required (outside of the WAMP folder) to old_ohp.ini . 为此,我将所有不需要的旧php.ini文件(在WAMP文件夹之外)重old_ohp.iniold_ohp.ini

The error is unrelated to PHP. 该错误与PHP无关。 It means you are somehow relying on Apache's mod_deflate, but that Apache module is not loaded. 这意味着您以某种方式依赖于Apache的mod_deflate,但未加载Apache模块。 Try enabling mod_deflate in httpd.conf or commenting out the offending line (search for DEFLATE in httpd.conf). 尝试在httpd.conf中启用mod_deflate或注释违规行(在httpd.conf中搜索DEFLATE)。

As for the PHP curl extension, you must make sure it's activated in php.ini. 至于PHP curl扩展,必须确保已在php.ini中将其激活。 Make sure extension_diris set to the directory php_curl.dll is in: 确保将extension_diris设置为目录php_curl.dll位于:

extension_dir = "C:/whatever" and then add extension_dir =“ C:/ whatever”,然后添加

extension=php_curl.dll 扩展名= php_curl.dll

The steps are as follows: 步骤如下:

  1. Close WAMP (if running) 关闭WAMP(如果正在运行)
  2. Navigate to WAMP\\bin\\php\\<your version of PHP> 导航到WAMP\\bin\\php\\<your version of PHP>
  3. Edit file php.ini 编辑文件php.ini
  4. Search for curl, uncomment extension=php_curl.dll 搜索curl,取消注释extension=php_curl.dll
  5. Navigate to WAMP\\bin\\Apache\\<your version of Apache>\\bin\\ 导航到WAMP\\bin\\Apache\\<your version of Apache>\\bin\\
  6. Edit file php.ini 编辑文件php.ini
  7. Search for curl, uncomment extension=php_curl.dll 搜索curl,取消注释extension=php_curl.dll
  8. Save both 同时保存
  9. Restart WAMP 重新启动WAMP

I think cURL doesn't work with WAMP 2.2e. 我认为cURL不适用于WAMP 2.2e。 I tried all your solutions, but it still did not work. 我尝试了所有的解决方案,但仍然无法正常工作。 I got the previous version, (2.2d) and it works. 我得到了以前的版本(2.2d),它可以工作。

So just download the previous version :D 因此,只需下载以前的版本:D

Well, just uninstall WAMP 64-bit and go with the 32-bit version. 好吧,只需卸载64位WAMP并使用32位版本即可。 It worked in my case. 就我而言,它奏效了。

This is how I've managed to load CURL correctly. 这就是我设法正确加载CURL的方式。 In my case php was installed from zip package, so I had to add php directory to PATH environment variable. 在我的情况下,php是从zip软件包安装的,因此我不得不将php目录添加到PATH环境变量中。

Ensure that your system PATH environment variable contains the directory in which PHP is installed. 确保系统PATH环境变量包含PHP安装目录。 Stop the Apache server and restart it once more. 停止Apache服务器,然后再次重新启动它。 With luck CURL will start working. 幸运的是,CURL将开始工作。

为我工作: http : //www.mediafire.com/?3ay381k3cq59cm2下载将文件粘贴到ext文件夹PHP 5.4.3中

I had the problem with not working curl on win8 wamp3 php5.6. 我在win8 wamp3 php5.6上无法使用curl时遇到问题。 Reinstalling wamp (x64 version as I had x64 in system info) made it work fine. 重新安装wamp(x64版本,因为我在系统信息中有x64)使其工作正常。

php.ini文档中取消注释"curl=cainfo" 。这在安装Prestashop时对所有其他方法仍然无效,这对我有帮助。

This is what worked for me 这就是对我有用的

Answered by Soren from another SO thread - CURL for WAMP 由另一个SO线程的Soren回答-WAMP的CURL

"There seems to be a bug somewhere. If you are experiencing this on Win 7 64 bit then try installing apache addon version 2.2.9 and php addon version 5.3.1 and switching to those in WAMP and then activating the CURL extension. That worked for me." “似乎在某处存在一个错误。如果您在Win 7 64位上遇到此错误,请尝试安装apache插件版本2.2.9和php插件版本5.3.1,然后切换到WAMP中的版本,然后激活CURL扩展。为了我。”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM