Trouble Enabling cURL on Ubuntu 11.10
Solution 1
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.
Solution 2
If you'r using Ubuntu or have more than one php.ini you may face this problem of enabling extension=php_curl.dll.
It's curious but I was facing this problem using UBUNTU. For some reason it was calling a .dll file, but linux uses .so files.
First thing to do is echo phpinfo(); in a .php file to check what php.ini is getting loaded.
Configuration File (php.ini) Path /etc/php/7.1/apache2 Loaded Configuration File /etc/php/7.1/apache2/something/php.ini
So if you change only in one file it may not have the correct effect.
In my case whas in /etc/php/7.1/apache2/php.ini and CURL was calling this way: ;extension=curl.dll
Change to extension=curl.so
Save and restart apache: sudo systemctl restart apache2
Afsheen Khosravian
Updated on June 29, 2022Comments
-
Afsheen Khosravian almost 2 years
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?