简体   繁体   中英

How to enable CurlHttpClient for WAMP in PHP 7.4+?

I'm trying to open the index_dev.php file for a site on my Wampserver and I'm getting this error:

Internal Server Error - PHP Warning - Configure the "curl.cainfo", "openssl.cafile" or "openssl.capath" php.ini setting to enable the CurlHttpClient

I tried to do some research on how to enable curl on WAMP, but all of the info I was seeing was for PHP 5.x

As far as configuring, I don't have a clue what I should do to the "curl.cainfo", "openssl.cafile" or "openssl.capath" settings in my php.ini files.

Thanks in advance for your help!

Go to https://curl.se/docs/caextract.html and download the latest .pem file.

Copy the .pem file to..... well I put mine in C:\wamp64\bin\php called cacert.pem

This contains a whole bunch of certificates and because the file is created by Mozilla we sort of trust it.

Now using the WAMPManager, edit your current php.ini file by

left click wampmanager -> PHP -> php.ini

Find this parameter, it will be commented out with a ;

;openssl.cafile=

Change it to

openssl.cafile="c:/wamp64/bin/php/cacert.pem"

Save the edit, and then restat Apache to activate the change

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM