2

There are many similar topic, but no solution has solved my problem on window 10 (on a new computer, the computer is full clean).

I install EasyPhp with php 5.6.17 on windows 10, well done! => curl_init() doesn't work

Now i want to install curl. First, in php.ini i uncomment the line "extension=php_curl.dll" (it's the good php.ini, i see the path in phpinfo()), and restart Apache. => curl_init() doesn't work

I add libeay32.dll, libssh32.dll and ssleay32.dll in Windows/system32. => curl_init() doesn't work

At this step, curl work done on my windows 7.

I add libeay32.dll, libssh32.dll and ssleay32.dll in Apache/bin. => curl_init() doesn't work

I add php_curl.dll in Windows/system32. => curl_init() doesn't work

I try php_curl.dll 32 and 64. => curl_init() doesn't work

I install the software OpenSSL (ssl required for curl). => curl_init() doesn't work

I have no error message except "Fatal error: Call to undefined function curl_init()". phpinfo() never display the curl module.

I'm running out of solution, any idea ?

Jeremy
  • 279
  • 2
  • 13

4 Answers4

4

I found an issue (after one full day on this problem). If you encounter the same problem, try this :

  • open command prompt and go to your php directory root
  • exec : deplister.exe ext\php_curl.dll
  • check dependencies

For me the file libssh32.dll was missing, but it was in Windows/system32 and apache/bin. To solve the problem, i add the php directory in the path windows, and copy the file libssh32.dll in the php directory.

Source

Community
  • 1
  • 1
Jeremy
  • 279
  • 2
  • 13
  • If I read one more suggestion on SO (or any other website for that matter) to add the PHP folder to PATH I'm going to scream! THIS DOESN'T WORK!!! At least not with PHP 7.1.0 and Windows 10. I've also tried everything the OP said, but still nothing!! WTF gives PHP devs?!?! Do I need to downgrade just to get this to work?! – Kenny83 Dec 22 '16 at 09:41
  • C:\php>deplister.exe ext\php_curl.dll php5ts.dll,OK LIBEAY32.dll,OK WS2_32.dll,OK libssh2.dll,OK SSLEAY32.dll,OK WLDAP32.dll,OK Normaliz.dll,OK KERNEL32.dll,OK MSVCR110.dll,OK this is what I get and cURL still not working. – vaske Jan 11 '17 at 20:06
3

I had exactly the same problem with this dev-setup:

  • Windows 10
  • PHP 5.6.27
  • Apache 2.2 (Yes, I know v2.4 is newer)

In PHP-CLI it works (php curl ext is loaded) but not when running through Apache (php curl ext is not loaded).

After spending a considerable time reading about this and trying different solutions it was *Jeremy that helped me most with the "deplister"-command.

It turns out (for me) the same dll-files (like libeay32.dll and ssleay32.dll) where present in various folders (like php/, apache/bin and windows/system32). However, even named the same, there where different versions of these, indicated by their different dates and sizes.

What made php-curl magically work for me was to replace libeay32.dll and ssleay32.dll in apache/bin with the newer versions I found in php/ (php root folder), and restart the apache service.

All these folders are present in the system PATH, but Apache obviously looks in it's own bin-folder first. So, I found it better to copy newer dll's to the Apache bin-folder, rather than relying on the system PATH.

Hope it may help someone else.

karpy47
  • 860
  • 5
  • 12
1

In addition to kapy47 answer: in my case I checked libssh2.dll in apache/bin and php directories they was different versions. I replaced with the newer versions in apache/bin and problem was solved

DI_DJON
  • 101
  • 1
  • 3
0

System Configuration: OS: Win 10 64Bit Server: Wamp Php Version: 5.6.40

Copy libssh2.dll file form your php version folder in Wamp and put it in apache/bin then restart apache, hurray now curl_init will run perfectly!

Karthick
  • 281
  • 2
  • 7