Saffrongeek’s Diarylog
…..memoirs moments opened…

cURL : Enabling [ PHP, Ubuntu ]

To check whether the curl is enabled in your environment, create a php file as below and browse to file know the details.

<?php
echo ‘<pre>’;
var_dump(curl_version());
echo ‘</pre>’;
?>

save as testCurl.php

Fatal error: Call to undefined function curl_version() indicates is not enabled. To enable curl now open you php.ini file and look for this line: extension=php_curl.dll

Remove the semi-colon in front of extension=php_curl.dll

For php 5 , we need not recompile again for curl and curl devel to be included . We could follow the following as ‘raptormanod’ mentions in forum.

Step1. Open terminal and type :sudo synaptic

saffrongeek@saffrongeek-laptop:~$ sudo synaptic

Step2.Search for curl, select All and type ‘curl’ in search box and search. Check the php-curl from the searched list.

Step3.Apply the packages. Then open up your php.ini file at sudo vi /etc/php5/apache2/php.ini
Step4. Add the following line.
extension=php_curl.dll

Step5.Save and restart Apache:
sudo /etc/init.d/apache2 restart
——————————– Terminal————————————

saffrongeek@saffrongeek-laptop:~$ sudo synaptic

saffrongeek@saffrongeek-laptop:~$ sudo vi /etc/php5/apache2/php.ini
saffrongeek@saffrongeek-laptop:~$ restartapache
* Restarting web server apache2                                                                                                                              … waiting

————————————————————————————————-

6 Responses to “cURL : Enabling [ PHP, Ubuntu ]”

  1. Thank you. It worked. Trick is to install all the curl components available from Synaptic manager

  2. Thanks for the little howto saved me from banging my head against the table trying to get my development enviroment online.


Leave a Reply