如何在Windows上安装cURL? [英] How do I install cURL on Windows?

查看:165
本文介绍了如何在Windows上安装cURL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已遵循以下所有说明: http://www.tonyspencer.com/2003/10/22/curl-with-php-and-apache-on-windows/



安装& config apache
获取PHP5包
并获取CURL包。



我运行apache并运行PHP脚本。没问题。
但是当我使用curl运行php脚本时,它失败。



它返回: **调用C:\Program Files \Apache Software Foundation \Apache2.2中未定义的函数curl_version \htdocs\ testing.php on line 5 **



其中第5行是一个调用 curl_init ()



我输出php -i以查看是否调用了正确的扩展路径。已正确设置:

  extension_dir => C:\PHP\ext => C:\PHP\ext 
cURL support => enabled
cURL Information => libcurl / 7.16.0 OpenSSL / 0.9.8g zlib / 1.2.3

我甚至试图运行 curl_version()但仍然会出现同样的错误。

看起来PHP找不到CURL扩展名,但是 php.ini (以及php -i)显示它已设置。



任何想法? :)

  P.S>系统我运行:
Windows XP
Apache 2.2
PHP 5.2.6
CURL Win32通用二进制文件:Win32 2000 / XP metalink 7.19.0二进制SSL启用Daniel Stenberg 249 KB

我没有得到这个:

  Win32 2000 / XP 7.19.0 libcurl启用SSLGünterKnauf 1.55 MB 
我应该得到这个吗?






我需要使用CURL的原因是是我的项目的要求。所以,我只能坚持下去。
XAMPP ...它在Windows中如何工作?有任何网站,你可以推荐吗?谢谢。



我已经尝试了很多安装cURL的东西,并检查一切,但仍然,我仍然围绕着这个问题,不知道发生了什么。



Apache服务器使用正确的PHP.ini。并且PHP.ini具有正确的extension_dir和extension = php_curl.dll
我不知道为什么它不工作。甚至我按照每一步设置它。 :(

解决方案

你可能错了你需要编辑的PHP.ini首先,添加一个PHPinfo



写下您现在在变量列表中看到的PHP ini目录路径
您可能会注意到



启用扩展



完成: - )


I have followed all the instructions here: http://www.tonyspencer.com/2003/10/22/curl-with-php-and-apache-on-windows/

to install & config apache get the PHP5 packages and get the CURL packages.

I run the apache and run a PHP script. no problem. but when I run the php script with curl, it fails.

It returns: **Call to undefined function curl_version() in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\testing.php on line 5**

In which line 5 is a called to curl_init()

I output the php -i to see whether the right path to extension is called. It is correctly set:

extension_dir => C:\PHP\ext => C:\PHP\ext
cURL support => enabled
cURL Information => libcurl/7.16.0 OpenSSL/0.9.8g zlib/1.2.3

I even tried to run curl_version() but still, same kind of error comes up.
It looks like the PHP can't find the CURL extension, but the php.ini (and also php -i) shows that it is set.

any idea? :)

P.S>  System I m running on:
Windows XP
Apache 2.2
PHP 5.2.6
CURL Win32 Generic Binaries: Win32 2000/XP  metalink    7.19.0  binary  SSL enabled     Daniel Stenberg     249 KB

I didn't get this:

Win32 2000/XP   7.19.0  libcurl     SSL enabled     Günter Knauf    1.55 MB
Should I get this one instead?


The reason I need to use CURL is that it is the requirement from my project. So, I can only stick with that. XAMPP... how does it work in Windows? Is there any site that you can recommend? Thanks.

I have tried a lot of things on installing cURL and check everything, but still, I'm stilling circling around the problem and have no idea what's going on.

The Apache server uses the right PHP.ini. and the PHP.ini has the correct extension_dir and extension=php_curl.dll I have no idea why it doesn't work. even I follow every step for setting it up. :(

解决方案

You're probably mistaking what PHP.ini you need to edit. first, add a PHPinfo(); to a info.php, and run it from your browser.

Write down the PHP ini directory path you see in the variables list now! You will probably notice that it's different from your PHP-CLI ini file.

Enable the extension

You're done :-)

这篇关于如何在Windows上安装cURL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆