Apache 2.4.23 PHP7.x Windows 10 x64 php_curl not working
Asked Answered
B

1

2

I was trying to upgrade my server to latest Apache 2.4.23 and PHP 7.1 but it fail to load php_curl library, don't know why.

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

I have tried followings

  1. Change extension path to full path like d:\webserver\php\ext
  2. Copy php_curl.dll, libssh2.dll, libeay32.dll, ssleay32.dll to System32, php/ext, apache/bin, php
  3. Added php path system variable
  4. Have tried both PHP7 and PHP7.1
  5. All of these are x64 and all other extension loaded successfully and server working but only php_curl is not working
  6. uncommented extension in php.ini

  • Apache 2.4.23 x64
  • PHP7 and Also tried PHP7.1 (Thread Safe) x64
  • Windows 10 x64
Breaker answered 12/12, 2016 at 18:38 Comment(9)
Take the path to php off the PATHWitkowski
The dll's only need copying into the apache\bin folderWitkowski
DONT copy dll's to the \windows\system32 folderWitkowski
Did you check all these extensions were activated in yout new php.ini files?Witkowski
Did you copy the php.ini file from \php\ to \apache\bin\Witkowski
@Witkowski I already tried all that except copying php.ini to apache/binBreaker
Yes but most of what you did should be UNDONE as it is wrongWitkowski
I tried all combination, however copy php directory from wamp does the trick.Breaker
See also #16424617Genarogendarme
K
1

Solution: Put libeay32.dll, libssh2.dll, ssleay32.dll files under dir specified in httpd.conf's ServerRoot directive. These dlls can be found compiled under php root folder.

Reasons:

Problem is php_curl.dll requires to access following libraries while loading: libeay32.dll, libssh2.dll, ssleay32.dll and it does not make sense if you put them in ./php/ext dir or if you put php extensions in php root dir.

Of course you can put them in c:\Windows or in some global folder defined in PATH but if you dont want to do this and you want that your apache+php installation was portable:

The path specified in ServerRoot in httpd.conf is treated as home path for php. The behaviour is similar to situation where you include ./path/to/some.php file in ./index.php and home path for some.php file is still ./ the dir where index.php resides.

In shorts just put those three dlls right in dir you specified in httpd.conf ServerRoot directive and php_curl.dll will not fail to load again.

Kamerman answered 13/12, 2016 at 9:39 Comment(2)
Yes I already read that solution and tried, its not working. However I fixed it by copying php directory from wamp, seems like these dll files are buggy and wamp developer seems compile themselves.Breaker
I encountered this problem in the last couple of days, for both curl and openssl. It strikes me that adding the PHP installation folder into the system path is rather simpler than copying various DLLs from the PHP folder to the Apache folder - and I can confirm it works.Heavyarmed

© 2022 - 2024 — McMap. All rights reserved.