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
- Change extension path to full path like d:\webserver\php\ext
- Copy
php_curl.dll, libssh2.dll, libeay32.dll, ssleay32.dll
to System32, php/ext, apache/bin, php
- Added php path system variable
- Have tried both PHP7 and PHP7.1
- All of these are x64 and all other extension loaded successfully and server working but only php_curl is not working
- uncommented extension in php.ini
- Apache 2.4.23 x64
- PHP7 and Also tried PHP7.1 (Thread Safe) x64
- Windows 10 x64
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.