Search code examples
phpapachecurl

cURL is enabled in php.ini but still not working


I have enabled the cURL extention in he php.ini folder, I have copied mutliple dll files from the PHP folder into the Apache Bin folder and the System 32 folder but cURL is still not enabled on my system.

All the solutions that I have looked at:

How to enable cURL in PHP / XAMPP http://php.net/manual/en/curl.installation.php http://php.net/manual/en/curl.installation.php#115953 http://php.net/manual/en/curl.installation.php#117372

I know this because I still see the following error:

Fatal error: Call to undefined function curl_init() in C:\AMP\sites\ftp-crawl\index.php on line 55

When I run only phpinfo(), there are no cUrl options. The only mention of cURL is under module authors and its value is cURL: Sterling Hughes

I am running a windows 10 developer machine with PHP, MySQL and Apache installed.

What do I still need to do or check to enable curl?


Solution

  • I resolved the issue by editing my PHP.ini to include the full path of the extension as opposed to just the name.

    So where most php.ini files just have this line of code:

    extension=php_curl.dll

    I changed it to look like this:

    extension=C:\amp\PHP\ext\php_curl.dll

    I have no idea why PHP/Apache couldn't show an error while I had extension=php_curl.dll in my php.ini. At least saying something like dll missing or something like that, but that resolved my issue.