安装/配置
在线手册:中文  英文

安装

要使用PHP的cURL支持你必须在编译PHP时加上--with-curl[=DIR] 选项,DIR为包含libinclude的目录路径。在include目录中必须有一个名为curl,包含了easy.hcurl.h的文件夹。lib文件夹里应该有一个名为libcurl.a的文件。对于PHP 4.3.0你可以配置--with-curlwrappers 使cURL使用URL流。

Note: Win32用户注意
要在Windows环境下使用这个模块,libeay32.dllssleay32.dll必须放到PATH环境变量包含的目录下。 不用cURL网站上的libcurl.dll


安装/配置
在线手册:中文  英文

用户评论:

musicdev at gmail dot com (2013-05-15 00:46:27)

A tip for users that now use the latest version of Windows 7 Ultimate, Apache 2.2.22 and PHP 5.4.4. If you manually installed PHP and did not change the PHP folder name such as "C:\php-5.4.4-Win32-VC9-x86" you don't need to add the curl libs into the System32 directory. Instead, modify the php.ini cURL extension to point directly to the php_curl.dll as follows:
extension=C:\php-5.4.4-Win32-VC9-x86\ext\php_curl.dll
I added the libs to system32 and moded the path as well just in case. Worked well for me.

jmichieli76 at yahoo dot ca (2012-06-18 14:03:31)

It should be noted that on a standard installation of php 5.2.17 on windows has this functionality installed and enabled by default.

y dot gonzalez at bifie dot at (2011-10-13 05:06:07)

For users of win7 64:
I just copied the library php_curl.dll to System32 and it works like charm ;-)

Joseph Marlin (2011-06-13 10:57:30)

Ubuntu 11.04
I already had Apache and PHP5 setup, but simply adding php5-curl and curl did *not* work. I also had to get libcurl3 and libcurl3-dev. The full command:
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
You'll know if it works because phpinfo() will get a new section with Curl info.

Anonymous (2011-01-04 12:39:30)

For Windows 64, put the DLLs into the Windows/SysWOW64 Folder.

Anonymous (2010-11-30 17:40:52)

It's not sufficient to put libeay32.dll and ssleay32.dll into your path. They also need to be in the PHP directory or it will not function, apparently.

wixelbomb at yahoo dot com (2009-12-28 11:17:36)

Just an additional note for Windows XP installations ...
The instructions others have courteously given still lack one small item for those who have the Windows/system32 directory as the repository for the .dll files concerned with php_curl.
Go to the ext directory of your php installation and copy php_curl.dll to the Windows/system32 folder after you have followed the advise given elsewhere.
So ...
1) remove ';' from extension=php_curl.dll in php.ini
2) ensure that ssleay32.dll and libeay32.dll are in Windows/system32.
3) Copy php_curl.dll into Windows\System32 as well.
G'day
bearstate

regs at voidship dot net (2008-09-23 09:45:53)

If you're dense like I am, spare yourself the trouble on an Ubuntu system (probably Debian too) and...
$ sudo apt-get install php5-curl
Then feel dumb, but not as dumb as me.

cristianods at yahoo dot com (2008-08-14 06:53:06)

Tip for Installing cURL with AppServ development server on Windows
If you are running AppServ as a WAMP development environment on a Windows machine, you may experience difficulty installing cURL. Here are some helpful steps:
First go to the PHP directory and copy the following libraries to the windows/system32 dir.
ssleay32.dll
libeay32.dll
Open the php ini file and remove the ; from extension=php_curl.dll
Reboot your machine to load […]

comments at adstation-systems dot com (2008-08-09 08:23:03)

You may be confused, as I was, by the instructions for installing cURL in php. The instruction "To use PHP's cURL support you must also compile PHP --with-curl[=DIR]..." was murky to me, since I didn't compile php when I installed it. I just copied all of the necessary files to the correct folders as described very clearly in the php manual.
I am using Windows XP and Apache with php 5.1.6. In this situation, and it may apply to php versions of 5.0 and later, all one needs to do is remove the ";" from the front of the directive extension=php_curl.dll. You should also check to make certain that libeay32.dll and ssleay32.dll are in your php directory with the other dll's. This directory should already be in you path, so the instruction to put them in you path is not critical.
You can then run phpinfo() and you should see a heading for curl in the listing.
Succinctly, my installation of cURL consisted of removing the semi-colon in front of the ;extension=php_curl.dll line in php.ini, saving php.ini and restarting Apache. You may wish to try this if you are using php 5.0 and later and are having difficulty understanding the instructions on the cURL installation page at php.net
You might also find the information at http://curl.phptrack.com/forum/viewtopic.php?t=52 useful.

rohanshenoy at w3hobbyist dot com (2008-07-21 09:21:28)

If you are using WAMPserver, you can enable the cURL extensions by
Left-click on WAMPserver tray icon>PHP>PHP extensions> Check php_curl.
Its already loaded on your disk, you have to activate it.

Christopher McCulloh (2008-07-18 08:40:13)

If you are using XAMPP (http://www.apachefriends.org/en/index.html) all you have to do is uncomment this line (line 582):
extension=php_curl.dll
in the xampp\apache\bin\php.ini file.

asi at neo dot ee (2002-12-13 07:28:02)

If anybody has problems with getting new curl working with older version of php then ...
I got stuck with installing curl-7.10.2+php 4.0.6 or better said configuring PHP with mentioned version of curl.
After some hopeless attempts to configure curl support into PHP I saw an error message:
"checking for cURL greater than or equal to 7.8... ./configure: line 11725: test: 070a02: integer expression expected"
after which configure said: "configure: error: cURL version 7.8 or later is required to compile php with cURL support"
On the mentioned line "test" is used to compare verion from curl-sonfig with preset value 70800 but ... test expects both values to be integer. From verson 7.8 curl outputs its version in hex...
I did'nt had the time to think about fixing this - I just deleted lines responsible and got curl working :)

易百教程