I simply have to use the latest cURL version (7.21.3) with PHP on my webserver. (Has to do with specific bug fixes)

It is not available by default on most current Linux variant repositories. (Natty Narwhal by Ubuntu is the only one and it's still in beta stages) - so I cannot simply run "aptitude install php5-curl" or similar to get it (the very latest version of cURL) installed.

How would one go about installing the very latest PHP + cURL packages?

Is it as simple as changing the to-download file for cURL in a repository somewhere? (ie. changing a text file's entry somewhere from http://curl.haxx.se/download/curl-7.21.0.tar.gz to http://curl.haxx.se/download/curl-7.21.3.tar.gz or something..?)

Basically I need the very latest cURL library running with PHP on Linux. How would you personally go about doing that?


Add natty repository:

$sudo echo "deb http://us.archive.ubuntu.com/ubuntu/ natty main universe multiverse" >> /etc/apt/sources.list
$sudo apt-get update

Create /etc/apt/preferences(change lucid, to your release):

Package: *
Pin: release a=natty
Pin-Priority: -10

Package: *
Pin: release a=lucid
Pin-Priority: 900

Install last php5-curl:

$sudo apt-get install -t natty php5-curl


$php -i | grep -i curl
cURL Information => 7.21.3

php -r 'var_dump(curl_version());'

or download php5 and curl source codes and build.

  • If you use the source - do uninstall the packaged versions first! Otherwise you're going to get into difficulties of the system tries to upgrade them. – symcbean Feb 3 '11 at 9:33
  • or use different prefix(./configure) – alvosu Feb 3 '11 at 9:40
  • How do you mean "or use a different prefix(./configure)" ??? Sorry, total linux noob here. – darkAsPitch Feb 3 '11 at 21:45
  • When configure curl and php and argument --prefix=/srv/php(./configure .... --prefix=/srv/php). – alvosu Feb 4 '11 at 4:00
  • Ok went through everything step by step. But noticed it was downloading from maverick still. So I completely erased maverick's sources.list file and replaced it with natty's just for the php install. And I still got the same errors. If you could explain the compilation of php+curl a bit further in your answer I think that should do it! Thank you for all your help! – darkAsPitch Feb 7 '11 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.