6

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?

6
  • Did u restarted the server? you are using wamp ya xamp? Commented May 4, 2016 at 7: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. Commented May 4, 2016 at 7:47
  • stackoverflow.com/questions/12076641/… Commented May 4, 2016 at 8:01
  • stackoverflow.com/questions/12380670/… Commented May 4, 2016 at 8: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. Commented May 4, 2016 at 8:17

5 Answers 5

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.

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

1 Comment

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

Comments

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.

Comments

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.

Comments

0

in php.ini ~770 line uncomment:

; On windows:
extension_dir = "ext"

1 Comment

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?

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.