Solution to PHP certificate authorization failure: 1. Enter the server terminal and execute the "wget --no-check-certificate https://curl.haxx.se/ca/cacert.pem" command to download the root certificate ; 2. Modify the configuration file; 3. Restart PHP.
The operating environment of this tutorial: Windows 7 system, PHP version 8.1, Dell G3 computer.
What should I do if the PHP certificate authorization fails?
Solution to the PHP environment (Pagoda Panel) prompt SSL certificate problem: certificate has expired
Recently, when helping a customer troubleshoot a problem, I encountered a 500 error and turned on the PHP Debug mode. I found that the detailed error content is as follows:
AWS HTTP error: cURL error 60: SSL certificate problem: certificate has expired
When I saw this prompt, I thought that the SSL certificate of the target address had expired, but I repeatedly confirmed that the target SSL certificate was normal and that other devices could request it. However, the PHP environment of the pagoda could not request the target URL. , try changing the PHP version and still the problem remains.
Solution
Enter the server terminal and execute the following command to download the root certificate:
#下载根证书 wget --no-check-certificate https://curl.haxx.se/ca/cacert.pem
Find your corresponding PHP version in the Pagoda background - Settings - Configuration file.
Search for the following 2 keywords: curl.cainfo/openssl.cafile and change the path of these 2 parameters to the path of the cacert.pem certificate above, for example :
curl.cainfo = /xxx/cacert.pem openssl.cafile=/xxx/cacert.pem
Then restart PHP, test again, and the problem is solved.
Recommended learning: "PHP Video Tutorial" "Pagoda Panel Usage Tutorial"
The above is the detailed content of What to do if the PHP certificate authorization fails. For more information, please follow other related articles on the PHP Chinese website!