Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I currently have PHP 5.3 installed with Apache in 10.04 Lucid. How can I add the PHP Curl libraries? Do I need to install any other dependencies for curl?

share|improve this question
up vote 235 down vote accepted

I believe that the package php5-curl should do the trick. Use the package manager of your choice and the deps should be taken care of.

sudo apt-get install php5-curl

You will need to restart the server afterwards:

sudo service apache2 restart

Alternatively, if you are using php-fpm, you'll need to restart php5-fpm instead

sudo service php5-fpm restart
share|improve this answer
It's perfectly fine asking here, but next time make sure to search the Software Center to save you some time ;) – Olivier Lalonde Feb 22 '11 at 11:06
This is on a server I'm managing from the CLI, what is the Software Center? – Darren Newton Feb 22 '11 at 12:22
@DarrenNewton The CLI equivalent would probably apt-cache search btw. – Nanne Dec 16 '12 at 10:03
@xav0989, it seems like this is a bug upstream, as on Debian it only reloads apache's config. It should restart apache. – d-_-b Aug 23 '13 at 0:37
debian info: on Debian 6 I didnt need to restart, installation just reloaded conf itself, and curl was working fine :) – jave.web May 4 '14 at 17:19

My conf: Ubuntu 11.10, already installed mysql,php5 and apache2, before installing php5-curl in terminal I did:

edit sources list like:

sudo gedit /etc/apt/sources.list

you can check your configuration in

Next command:

apt-get install aptitude

Next command:

aptitude install php5-curl

You get something like this:

The following NEW packages will be installed:
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 27.1 kB of archives. After unpacking 127 kB will be used.
The following packages have unmet dependencies:
php5-curl: Depends: php5-common (= 5.3.6-13ubuntu3.1) but 5.3.6-13ubuntu3.8 is installed.
The following actions will resolve these dependencies:

Keep the following packages at their current version:
1)     php5-curl [Not Installed]                          

Accept this solution? [Y/n/q/?] n

Your answer here is n

Next lines print out:

The following actions will resolve these dependencies:

Downgrade the following packages:                                             
1)     libapache2-mod-php5 [5.3.6-13ubuntu3.8 (now) -> 5.3.6-13ubuntu3.1 (oneiric)]
2)     php5 [5.3.6-13ubuntu3.8 (now) -> 5.3.6-13ubuntu3.1 (oneiric)]               
3)     php5-cli [5.3.6-13ubuntu3.8 (now) -> 5.3.6-13ubuntu3.1 (oneiric)]           
4)     php5-common [5.3.6-13ubuntu3.8 (now) -> 5.3.6-13ubuntu3.1 (oneiric)]        
5)     php5-gd [5.3.6-13ubuntu3.8 (now) -> 5.3.6-13ubuntu3.1 (oneiric)]            
6)     php5-mysql [5.3.6-13ubuntu3.8 (now) -> 5.3.6-13ubuntu3.1 (oneiric)]         

Accept this solution? [Y/n/q/?] y

Your answer here is y.

In your browser open phpinfo(), check property:

extension_dir   /usr/lib/php5/20090626+lfs

In that folder you should now have

Edit php.ini

nano /etc/php5/apache2/php.ini

find "dynamic extensions" add code below:

After that restart apache2 and check phpinfo(), curl must be enabled

share|improve this answer

You need to install the php5-curl package.

sudo apt-get install php5-curl
share|improve this answer

full solution for install LAMP and cURL extension:

sudo apt-get update
sudo apt-get install php5

sudo apt-get install libapache2-mod-php5

sudo apt-get install curl libcurl3 libcurl3-dev php5-curl

and then:

cd /etc/php5/apache2/

sudo nano php.ini

add this command:

the last thing restart apache

share|improve this answer

Run following command

sudo apt-get install curl libcurl3 libcurl3-dev php5-mcrypt php5-curl

share|improve this answer
What does php5-mcrypt have with this? – Starx Mar 23 at 13:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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