3

I can't get cURL to work from inside Apache by any means. It's actually fairly strange too provided that:

  1. I can execute my PHP pages from the CLI and it POSTs my requests perfectly fine
  2. When I look at my error logs, I get "PHP Fatal error: Call to undefined function curl_init()" as if the extension isn't installed at all. Similarly, a quick `phpinfo()` also yields such as if the extension isn't installed.

Additionally, when I built PHP, I opted the "--enable-curl" flag.

1
  • 4
    There are a different php.ini for the CLI and Apache maybe you Apache php.ini is not loading CURL Commented Jun 7, 2011 at 21:32

3 Answers 3

2

You are probably not loading the extension in the appropriate php.ini. The file should include something like:

[PHP_CURL]
extension=php_curl.dll

Also, --enable-curl is not a PHP configure option. --with-curl=[DIR] is the one you'd want. Check out the cURL installation instructions.

php_curl.dll should be inside PHP's ext directory when configured correctly.

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

Comments

0

I had same problem after installing php5-curl. I rebooted apache and that fixed it.

sudo /etc/init.d/apache2 restart for ubuntu 12.04

Comments

0

I had similar problem - worked from cli, silently failed from Apache 2.4

I've tried:

1) copying ssleay32.dll and libeay32.dll from php folder into apache\bin folder - didn't work

2) deleting ssleay32.dll and libeay32.dll from apache\bin folder completely - WORKED.

You should restart apache server each time you make change to make it work.

Also you should install both x86 and x64 versions of C++ Resistributable Visual Studio from Microsoft.

Comments

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.