Installing cURL in Linux


I have found this guide for installing cURL for PHP in Linux.
The problem is it explains how to install Apache, then cURL and then PHP.
I have already installed Apache and PHP. I just need to install cURL.
Does anyone know how it will differ, if at all, or a good tutorial somewhere?
Thanks for any help.


if you can install curl via pre-compiled binaries, do that (eg. something like yum)
otherwise, install curl in the same way

then to setup the curl module for php (without re-compiling php), just go into your php src directory (the one that was created when you untarred the php source)
cd to the ext/curl (or libcurl, one or the other) directory
type phpize, hit enter
type ./configure, hit enter
type make, hit enter
type make install, hit enter

then add the line (or libcurl, whatever it was earlier) to your php.ini file, just put it at the end of the file
and restart apache


THanks for this help.
I’ll try it. You may have noticed I reposted this question. Sorry for that. I thought the original hadn’t been sent and I only just found it by doing a search.
When you say install in the same way do you mean like this?

Change your working directory to the cURL source directory and invoke the configure script as follows:

> cd curl-7.12.2
> ./configure

After the configuration script runs, invoke make to compile the cURL sources:
> make

When the compilation finishes, become superuser and install cURL by typing make install at the shell prompt:

make install


I’m more than a bit confused by this now. I myself haven’t installed cURL yet but when I look at the phpinfo.php page it claims that cURL is enabled. This is how it should look, after you have installed it, according to the link in my first post here.
Also I have discovered that in my /usr/lib directory I have 2 libcurl files - and
I’m wondering if someone has at some point installed it (this is a machine that has been used by a number of people in the past).
However, the php.ini file has no mention of the file which you say should be added at the end.
I’ve decided to go ahead and try and test it (I need to use cURL for credit card verification) but Im not sure now if it is installed or not.
Have you any further ideas?

Thanks very much

yeah, by same way, i meant what you said
curl may have been instead as a php extension by someone else i guess
if does not appear in your php.ini
and you know that it’s not in your configure line
near the top of your phpinfo page, ther should be a line that says something like
.ini files parsed, there may be a curl.ini file there that is included by the php.ini file

if the curl extension was installed before you installed php, you might want to re-install it, to make sure that the curl extension matches your php version