What to do if the PHP certificate authorization fails

藏色散人
Release: 2023-03-17 11:58:02
Original
1669 people have browsed it

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.

What to do if the PHP certificate authorization fails

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
Copy after login

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
Copy after login

Find your corresponding PHP version in the Pagoda background - Settings - Configuration file.

What to do if the PHP certificate authorization fails

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
Copy after login

Then restart PHP, test again, and the problem is solved.

What to do if the PHP certificate authorization fails

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!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template