Php – Trouble Enabling cURL on Ubuntu 11.10

curllinuxPHPUbuntu

I have installed curl:

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

and I have updated my php.ini file to include:

extension=php_curl.dll

I check to see if curl is working with the following command:

php -i | grep curl

and I receive the following message:

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/php_curl.dll' – /usr/lib/php5/20090626+lfs/php_curl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/sqlite.so' – /usr/lib/php5/20090626+lfs/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
Additional .ini files parsed => /etc/php5/cli/conf.d/curl.ini,
curl

I also tested curl by creating a file called testCurl.php which contains the following:

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

When I navigate to localhost/testCurl.php I get an error: HTTP Error 500

Can anyone help me to get curl working?

Best Answer

You put the wrong info in your php.ini

extension=php_curl.dll

On Ubuntu/Unix that is

extension=php_curl.so

.so means Shared Object, that is a dynamic library the error messages speaks of. On Windows that is .dll, you probably just mixed that.

And it appears you try to load sqlite.so which does not exists. Normally you don't need to change your php.ini file when you install libraries on Ubuntu via apt, because the package scripts take care of that thanks to the work of the package maintainers.

Related Topic