Apache and PHP Curl Issue

1

In my apache error.log I have the following line: PHP Warning: PHP Startup: Unable to load dynamic library 'ext\php_curl.dll' - The specified procedure could not be found.\r\n in Unknown on line 0

However I have checked my PATH variable and the PHP directory is listed, the ext folder is set correctly and php_curl.dll exists in the folder.

I have reinstalled vc++ redistributes to ensure that there are no issues there.

During my checking I have found that all of the following ddl's are present when opening them from run (to test they can be found from the PATH variable):

  • ws2_32.dll
  • wldap32.dll
  • php7ts.dll
  • libeay32.dll
  • libssh2.dll
  • nghttp2.dll
  • ssleay32.dll
  • normaliz.dll
  • kernel32.dll
  • vcruntime140.dll
  • api-ms-win-crt-stdio-l1-1-0.dll
  • api-ms-win-crt-string-l1-1-0.dll
  • api-ms-win-crt-heap-l1-1-0.dll
  • api-ms-win-crt-convert-l1-1-0.dll
  • api-ms-win-crt-filesystem-l1-1-0.dll
  • api-ms-win-crt-runtime-l1-1-0.dll
  • api-ms-win-crt-utility-l1-1-0.dll
  • api-ms-win-crt-time-l1-1-0.dll
  • api-ms-win-crt-environment-l1-1-0.dll

I am unsure of what dependencies that php_curl could have, if you could provide any suggestions then this would be greatly appreciated.

More system info: Compiler MSVC14 (Visual C++ 2015)
Architecture x64
Windows 7 platform
PHP version 7.1.4
Apache version 2.4

Jim

Posted 2017-04-19T20:42:02.680

Reputation: 31

Answers

2

I had the same problem, but it only manifested when running PHP through Apache. In CLI it was fine - cURL was shown in phpinfo().

The solution was to replace several files in Apache's bin directory:

  • libeay32.dll
  • ssleay32.dll
  • libssh2.dll
  • nghttp2.dll

When PHP is run through Apache, its bin directory probably takes precedence over system %PATH% variable and therefore PHP's curl extension uses libraries from Apache, resulting in version mismatch (Apache's libraries seem to be older than required).

It should also be noted, that this behavior started (afaik) with PHP 7.1.

Jiri Hrazdil

Posted 2017-04-19T20:42:02.680

Reputation: 121

1This answer provided extra clue that other answers to this issue didn't have: nghttp2.dll needed to be included, particularly with PHP 7.1. – sam452 – 2018-04-08T03:22:12.817

0

After doing the dll copying above, make sure you have the below lines in your php.ini, and that the perm file is there. Don't forget to put your paths.

[curl] curl.cainfo = "C:\php\extras\ssl\cacert.pem"

[openssl] openssl.cafile = "C:\php\extras\ssl\cacert.pem" openssl.capath="C:\php\extras\ssl\cacert.pem"

Sherifan

Posted 2017-04-19T20:42:02.680

Reputation: 1

welcome to superuser:- could explain why the paths (not noted above) are required and any other details. again welcome to superuser, checkout [answer], [ask] and [help] as reference thankyou – mic84 – 2018-08-10T05:37:12.133