PHP cURL 不起作用 - Windows 7 64 位上的 WAMP
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10939248/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PHP cURL not working - WAMP on Windows 7 64 bit
提问by will.i.am
I got my WAMPinstalled on my windows 7 64bit. cURL is not working, but still I got it enabled from the WAMP tray.
我在 Windows 7 64 位上安装了WAMP。cURL 不起作用,但我仍然从 WAMP 托盘启用它。
I have also uncommented extension=php_curl.dllin php.inifor both the PHP and Apache folder.
我还取消extension=php_curl.dll了php.ini对 PHP 和 Apache 文件夹的注释。
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. Please see the application event log or use the command-lin sxstrace.exe tool for more detail."
PHP 启动:无法加载动态库 'c:/wamp/bin/php/php5.4.3/ext/php_curl.dll' - 应用程序无法启动,因为其并行配置不正确。请查看应用程序事件日志或使用命令行 sxstrace.exe 工具获取更多详细信息。”
How can I fix this problem?
我该如何解决这个问题?
回答by sublucent
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 PHPversion under "Fixed curl extensions:".
转到http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/并下载与您的PHP对应的 cURL 版本“固定卷曲扩展:”下的版本。
So if you have PHP 5.3.13, download "php_curl-5.3.13-VC9-x64.zip". Try the "VC" version first. Then replace the php_curl.dll in ext folder. This worked for me.
因此,如果您有 PHP 5.3.13,请下载“php_curl-5.3.13-VC9-x64.zip”。首先尝试“VC”版本。然后替换ext文件夹中的php_curl.dll。这对我有用。
回答by Farzan Balkani
I had the same exact issue. After trying almost everything and digging on Stack Overflow, I finally found the reason. Try downloading "fixed curl extension" separately from PHP 5.4.3 and PHP 5.3.13 x64 (64 bit) for Windows.
我有同样的问题。在尝试了几乎所有方法并在 Stack Overflow 上挖掘之后,我终于找到了原因。尝试从PHP 5.4.3 和 PHP 5.3.13 x64 (64 bit) for Windows分别下载“fixed curl extension” 。
I've downloaded "php_curl-5.4.3-VC9-x64", and it worked for me. I hope it helps.
我已经下载了“php_curl-5.4.3-VC9-x64”,它对我有用。我希望它有帮助。
回答by mpgn
回答by mjs
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. For this, I renamed all the old php.inifiles which are not required (outside of the WAMP folder) to old_ohp.ini.
我得到了缺少 php5.dll 的一致错误。为此,我将所有php.ini不需要的旧文件(在 WAMP 文件夹之外)重命名为old_ohp.ini.
回答by Suresh Kumar Amrani
The error is unrelated to PHP. It means you are somehow relying on Apache's mod_deflate, but that Apache module is not loaded. Try enabling mod_deflate in httpd.conf or commenting out the offending line (search for DEFLATE in httpd.conf).
该错误与 PHP 无关。这意味着您以某种方式依赖 Apache 的 mod_deflate,但未加载该 Apache 模块。尝试在 httpd.conf 中启用 mod_deflate 或注释掉违规行(在 httpd.conf 中搜索 DEFLATE)。
As for the PHP curl extension, you must make sure it's activated in php.ini. Make sure extension_diris set to the directory php_curl.dll is in:
至于 PHP curl 扩展,你必须确保它在 php.ini 中被激活。确保 extension_diris 设置为目录 php_curl.dll 位于:
extension_dir = "C:/whatever" and then add
extension_dir = "C:/whatever" 然后添加
extension=php_curl.dll
扩展名=php_curl.dll
回答by johnpaul
The steps are as follows:
步骤如下:
- Close WAMP (if running)
- Navigate to
WAMP\bin\php\<your version of PHP> - Edit file
php.ini - Search for curl, uncomment
extension=php_curl.dll - Navigate to
WAMP\bin\Apache\<your version of Apache>\bin\ - Edit file php.ini
- Search for curl, uncomment
extension=php_curl.dll - Save both
- Restart WAMP
- 关闭 WAMP(如果正在运行)
- 导航
WAMP\bin\php\<your version of PHP> - 编辑文件
php.ini - 搜索 curl,取消注释
extension=php_curl.dll - 导航
WAMP\bin\Apache\<your version of Apache>\bin\ - 编辑文件 php.ini
- 搜索 curl,取消注释
extension=php_curl.dll - 两个都保存
- 重启 WAMP
回答by flairon
I think cURL doesn't work with WAMP 2.2e. I tried all your solutions, but it still did not work. I got the previous version, (2.2d) and it works.
我认为 cURL 不适用于 WAMP 2.2e。我尝试了您的所有解决方案,但仍然无效。我得到了以前的版本 (2.2d),它可以工作。
So just download the previous version :D
所以只需下载以前的版本:D
回答by farhan ahmed
Well, just uninstall WAMP 64-bit and go with the 32-bit version. It worked in my case.
好吧,只需卸载 64 位 WAMP 并使用 32 位版本。它在我的情况下有效。
回答by Lixas
This is how I've managed to load CURL correctly. In my case php was installed from zip package, so I had to add php directory to PATH environment variable.
这就是我设法正确加载 CURL 的方式。在我的情况下,php 是从 zip 包安装的,所以我必须将 php 目录添加到 PATH 环境变量中。
回答by Terry Lin
Ensure that your system PATH environment variable contains the directory in which PHP is installed. Stop the Apache server and restart it once more. With luck CURL will start working.
确保您的系统 PATH 环境变量包含安装 PHP 的目录。停止 Apache 服务器并再次重新启动它。幸运的是,CURL 将开始工作。

