Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

5 Answers 5

up vote 91 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
    
worked great - thanks! –  Darren Newton Oct 25 '10 at 12:09
1  
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
1  
I'll add that I had to manually restart the webserver after having ran that command –  T0xicCode May 22 '12 at 8:15
3  
@DarrenNewton The CLI equivalent would probably apt-cache search btw. –  Nanne Dec 16 '12 at 10:03
1  
@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

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 http://repogen.simplylinux.ch/

Next command:

apt-get install aptitude

Next command:

aptitude install php5-curl

You get something like this:

The following NEW packages will be installed:
php5-curl{b} 
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 curl.so

Edit php.ini

nano /etc/php5/apache2/php.ini

find "dynamic extensions" add code below:

extension=curl.so

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: extension=curl.so

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

Your Answer

 
discard

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.