5

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?

Community
  • 1
  • 1
Jacques Koekemoer
  • 1,378
  • 5
  • 25
  • 50
  • Did u restarted the server? you are using wamp ya xamp? – Maha Dev May 04 '16 at 07:38
  • @MahaDev I am not using xamp, I am using a clean install of Apache and PHP. I have tried restarting the server multiple times. – Jacques Koekemoer May 04 '16 at 07:47
  • http://stackoverflow.com/questions/12076641/call-to-undefined-function-curl-init-with-wamp – Renjith V R May 04 '16 at 08:01
  • http://stackoverflow.com/questions/12380670/call-to-undefined-function-curl-init-error-in-wamp-2-2 – Renjith V R May 04 '16 at 08:02
  • Since it is not in the `phpinfo()` I suspect you might have edited the wrong `php.ini` file. The correct one should be in the `phpinfo()` output as well. – Tuim May 04 '16 at 08:17
  • @Tuim its defiantly the right `php.ini`, when I type in garbage text anywhere in the file (breaking it deliberately) Apache gives an error on restart. When I remove the text it works again. – Jacques Koekemoer May 04 '16 at 09:15

5 Answers5

2

I had the same problem. I fix it replacing the php_curl.dll. Maybe a file corruption.

In php.ini I setup with extension=php_curl.dll.

No more Call to undefined function curl_init() errors.

  • I ended up trying to replace the `php_curl.dll` from a working server and that didn't solve the issue either, it started working when I replaced the full path of the DLL in the `ini` file. I think somewhere it was looking in the wrong directory for the cURL directory – Jacques Koekemoer Aug 04 '16 at 08:38
1

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.

Jacques Koekemoer
  • 1,378
  • 5
  • 25
  • 50
0

I believe you edited the demo or wrong php.ini file. In your phpinfo you will find a path to the used php.ini file. It's next to the text: "Configuration File". Check out that file and make sure that the following option is set (by default it is commented out with a semicolon).

extension=php_curl.dll

If you can not find this line, you might have a different version of Apache. In this case you might find a directory called "mods-available" in which the curl extension lays. You need to move this file to the "mods-enabled" folder. Honestly I think this only applies to Linux environments, not sure about Windows.

John Smith
  • 965
  • 1
  • 9
  • 22
0

It means that the curl module is not installed on the server. This problem generally occurs with php5. You need to check if php5-curl module is installed or not. Also confirm if curl is installed on the system. Terminal command curl -v.

Manoj Thakur
  • 75
  • 1
  • 9
0

in php.ini ~770 line uncomment:

; On windows:
extension_dir = "ext"
JenHak
  • 1
  • 1
  • 1
    Thank you for contributing to the Stack Overflow community. This may be a correct answer, but it’d be really useful to provide additional explanation of your code so developers can understand your reasoning. This is especially useful for new developers who aren’t as familiar with the syntax or struggling to understand the concepts. **Would you kindly [edit] your answer to include additional details for the benefit of the community?** – Jeremy Caney Aug 21 '23 at 03:22