3

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?

darkAsPitch
  • 1,931
  • 4
  • 25
  • 42

1 Answers1

3

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

Test(curl_version):

$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.

alvosu
  • 8,437
  • 25
  • 22
  • 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 03 '11 at 09:33
  • or use different prefix(./configure) – alvosu Feb 03 '11 at 09:40
  • How do you mean "or use a different prefix(./configure)" ??? Sorry, total linux noob here. – darkAsPitch Feb 03 '11 at 21:45
  • When configure curl and php and argument --prefix=/srv/php(./configure .... --prefix=/srv/php). – alvosu Feb 04 '11 at 04: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 07 '11 at 07:50
  • Don't erased maverick's sources.list. Add natty's and configure preferences(/etc/apt/preferences) – alvosu Feb 07 '11 at 07:56