Home » Php » php – Call to undefined function curl_init() – with WAMP

php – Call to undefined function curl_init() – with WAMP

Posted by: admin April 23, 2020 Leave a comment

Questions:

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?

How to&Answers:

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

Answer:

Click on WAMP Icon > PHP > PHP Extensions > check php_curl.

If it’s checked uncheck it, check it again, and Restart all services. Should work.

If it still not working reinstall WAMP. Simple as it is.

Answer:

For me this did the trick: http://www.phpmind.com/blog/2011/02/how-to-enable-curl-in-wamp/

1) Close WAMP (if running)

2) Navigate to WAMP\bin\php(your version of php)\

3) edit php.ini

4) Search for curl, uncomment extension=php_curl.dll

5) Navigate to WAMP\bin\Apache(your version of apache)\bin\

6) edit php.ini

7) Search for curl, uncomment extension=php_curl.dll

8 ) Save both

9) Restart WAMP