PHP 7 curl not being loaded
Solution 1
In my case it worked when I also copied nghttp2.dll to Apache bin directory
Solution 2
I was looking for a solution a really long time, until I decided to read some comments on the PHP documentation site: http://php.net/manual/de/curl.installation.php
I fixed coping the following list files from php folder (in my case C:\xampp\php7)
libeay32.dll
libssh2.dll
ssleay32.dll
Some people also had to move nghttp2.dll for it to work.
To your apache/bin folder (C:\xampp\apache\bin in my case).
I also copied those to C:\Windows\System32, but I do not think any of these files were loaded.
EDIT: I successfully deleted these dlls from system32 folder and was able to run curl afterwards
Solution 3
It works if you set ssl VERIFYPEER
to false
curl_setopt($get, CURLOPT_SSL_VERIFYPEER, false);
it will works fine . you can also make curl work withe ssl by downloading the cacert.pem from https://curl.haxx.se/docs/caextract.html and Adding the cert to your php.ini file
curl.cainfo="C:\path\cacert.pem"
openssl.cafile="C:\path\cacert.pem"
and
curl_setopt($get, CURLOPT_SSL_VERIFYPEER, true);
will work too this way you can prevent man-in-the-middle attacks, check this link for more details http://thisinterestsme.com/php-curl-ssl-certificate-error/
Related videos on Youtube
Pedro
Updated on June 04, 2022Comments
-
Pedro almost 2 years
I have installed in my local computer apache 2.4 with PHP 7.1. I enabled curl in my php.ini (extension=php_curl.dll), but for some reason curl is not being loaded even after i enabled it, i made a phhinfo to check, and nothing, i also made a small script:
function isExtensionLoaded($extension_name){ return extension_loaded($extension_name); } echo isExtensionLoaded('curl');
And nothing, is blank, what it means is not being loaded, is something missing? Im on Windows 10.
-
hassan about 7 yearsmake sure that you've restarted your apache2 server
-
Vural about 7 years"blank" means, "its loading, but can't display" or "it throws error but error logging is not activated in php.ini" etc....
-
-
Pedro about 7 yearsHello is giving me this error: "PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PHP\ext\php_curl.dll"
-
Pedro about 7 yearsIts this: extension_dir = "C:\PHP\ext"
-
Vural about 7 yearsCan you please check
httpd.conf
file, I guess mod_ssl.so is not installed and check my updated answer please -
Pedro about 7 yearsYes, i already enabled, it was comment and i remove the comment :LoadModule ssl_module modules/mod_ssl.so
-
Adam Cameron over 6 yearsThose three and nghttp2.dll as well, for me. Cheers (also to @nick-proto)
-
Álvaro González almost 6 yearsI can't understand why third-party bundles are so popular yet you apparently always need to do workarounds like this for simple features. In the official PHP binaries curl always works out of the box :-?
-
Jerusalem Programmer about 2 yearsThanks, bro! Your solution helped me with my overlapping problem here:
https://stackoverflow.com/questions/71110013/how-to-enable-curl-locally-on-my-windows-10-so-that-my-php7-localhost-with-or-w?