Apache is giving me this error
PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: C:/Users/tester/Desktop/Web Server/php-7.2.5-Win32-VC15-x64/ext/curl (The specified module could not be found.), C:/Users/tester/Desktop/Web Server/php-7.2.5-Win32-VC15-x64/ext/php_curl.dll (%1 is not a valid Win32 application.)) in Unknown on line 0
This is a 64bit Windows server 2016 install.
This PHP https://windows.php.net/downloads/releases/php-7.2.5-Win32-VC15-x64.zip
This Apache: https://www.apachelounge.com/download/VC15/binaries/httpd-2.4.33-win64-VC15.zip
All the other modules work+load fine.
I've tried adding the ext path to my system variables.
I've tried using a 32bit version of PHP_curl.dll
I've tried copying libeay32.dll, libssh2.dll, ssleay32.dll into pretty much everywhere. Apache root, ext folder.
What else can I try here?
In the end I had to simply copy libcrypto-1_1-x64.dll, libssh2.dll, libssl-1_1-x64.dll and nghttp2.dll from the PHP folder into the apache bin folder.
Most probably it's a problem related only to Windows, if you are using Apache2.4 + Php7, the trick consists in using LoadFile directive to force the loading of CURL as explained in my Mini Guide. You don't need strange things to have CURL working on your machine, you need to edit the file httpd.conf and add this:
LoadFile "${MY_PHP_ROOT}/libssh2.dll"
So full PHP incantation in httpd.conf might look something like this:
##
#BEGIN PHP
Define MY_PHP_ROOT "c:/Dev/PHPs/PHP74"
AddHandler application/x-httpd-php .php
AddType application/x-httpd-php .php .html
LoadModule php7_module "${MY_PHP_ROOT}/php7apache2_4.dll"
PHPIniDir "${MY_PHP_ROOT}/"
# Load library required for CURL
LoadFile "${MY_PHP_ROOT}/libssh2.dll"
#END PHP
##
Hope this helps.
PS: Order of LoadModule/LoadFile doesn't matter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With