Call to undefined function curl_init() - with WAMP

Rubberduck picture Rubberduck · Aug 22, 2012 · Viewed 59k times · Source

I'm trying to get cUrl to work, and I'm stumped.

I've uncommented extension=php_curl.dll in the php.ini file and checked that php_curl.dll exists in the directory that extension_dir points to. I've also checked that the php.ini in the Apache directory is right.

I've copied the libcurl.dll's to Windows/System32, Windows/SysWOW64 and wamp\bin\php\php5.4.3

And I've restarted the services every time.

And still I get the Fatal error: Call to undefined function curl_init(). Curl doesn't show up when I run a phpInfo(). But when I look in the WAMP-menu PHP->PHP extensions php_curl does has a checkmark.

Any hints?

Edit:

@Daniel_M: The loaded ini is the one in the Apache directory, and extension=php_curl.dll has been uncommented, and extension_dir does point to the php/php5.4.3/ext directory where the php_curl.dll (and libcurl.dll) are located.

@ficuscr: I've copied the libcurl.dll v.7.27.0 all over the place. Where should I place it?

In general: When php_curl is unchecked in the PHP > PHP Extensions menu, the fatal error is preceeded by: SCREAM: Error suppression ignored for. This doesn't happen when php_curl is checked. The fatal error message is the same in either case. A clue?

Answer

Chu Khanh Van picture Chu Khanh Van · Sep 8, 2012

WAMP 2.2 comes with a wrong cURL extension. You should download the fixed file from the following link:
http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/. Then replace the file php_curl.dll into /php5.4.3/ext/.