2

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!

4
  • 1
    Please check if your phpinfo() output shows path of php.in as /etc/php/php.ini? Commented Mar 16, 2011 at 2:50
  • 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? Commented Mar 16, 2011 at 2:54
  • @anubhava: Loaded Configuration File shows /etc/php/php.ini Commented Mar 16, 2011 at 3:17
  • @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. Commented Mar 16, 2011 at 3:24

1 Answer 1

2
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.

Sign up to request clarification or add additional context in comments.

15 Comments

Fatal error: Call to undefined function dl()... The PHP docs at us2.php.net/dl say that "This function has been removed from some SAPI's in PHP 5.3."
Yes. Try it with the CLI version (for our testing purposes here). There it's still allowed.
Okay, I get this: PHP Warning: Module 'curl' already loaded in Unknown on line 0
This is odd. Test var_dump(function_exists("curl_init")); in the CLI version.
Unbelievable. I performed a soft reboot of the server and it worked instantly. Note to self: Never trust /etc/rc.d/nginx restart
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.