2
votes

cURL does not appear in phpinfo() and fails inside of PHP scripts even after ensuring the following:

  • curl.so does exist in /usr/lib/php/modules/curl.so along with my other successfully working PHP modules.

  • /usr/lib/php/modules/curl.so is the only place where curl.so is to be found on the system.

  • extension=curl.so is uncommented in php.ini

  • /etc/php/php.ini is the only place where php.ini is to be found on the system.

  • I restarted my webserver several times.

  • The phpinfo Configure Command shows: '--with-curl=shared'

However, the big blue block that shows "curl" settings (as typically found in phpinfo on other systems) is not appearing. Furthermore, function_exists('curl_init') returns false inside of PHP.

I must be missing something... But what?

Your help is greatly appreciated!

1
Please check if your phpinfo() output shows path of php.in as /etc/php/php.ini? - anubhava
curl=shared means that it will be looking for curl's libraries as part of the system. Have you made sure that curl and the curl libraries are installed at the system level? Also, is the extension directory in your php.ini pointing at the right place? - Charles
@anubhava: Loaded Configuration File shows /etc/php/php.ini - OCDev
@Charles: I installed curl and php-curl via the Arch Linux package manager: pacman -S curl and pacman -S php-curl and I also did this explicitly for all of their listed dependencies just in case something strange prevented them from resolving dependencies automatically. - OCDev

1 Answers

2
votes
dl("curl.so");

Try this eventually even with the complete path to the library. And also check if this works on the commandline. If the .so should be incompatible to your PHP interpreter (or be otherwise corrupt), then you will not see any messages in the output from a phpinfo script. PHP fails otherwise silently if it was referenced from the php.ini. Any issues would only turn up on the console or in the Apache error log.