且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PHP - SSL 证书错误:无法获取本地颁发者证书

更新时间:2022-06-10 05:14:57

终于搞定了!

  1. 下载证书包.

把它放在某个地方.就我而言,那是 c:wamp 目录(如果您使用的是 Wamp 64 位,则它是 c:wamp64).

Put it somewhere. In my case, that was c:wamp directory (if you are using Wamp 64 bit then it's c:wamp64).

在 Apache 中启用 mod_ssl 和在 php.ini 中启用 php_openssl.dll(通过删除 取消注释它们;代码>开头).但要小心,我的问题是我有两个 php.ini 文件,我需要在这两个文件中都这样做.一个是您从 WAMP 任务栏图标中获得的,另一个在我的情况下位于 C:wampinphpphp5.5.12

Enable mod_ssl in Apache and php_openssl.dll in php.ini (uncomment them by removing ; at the beginning). But be careful, my problem was that I had two php.ini files and I need to do this in both of them. One is the one you get from your WAMP taskbar icon, and another one is, in my case, in C:wampinphpphp5.5.12

在两个 php.ini 文件中将这些行添加到您的证书中:

Add these lines to your cert in both php.ini files:

curl.cainfo="C:/wamp/cacert.pem"
openssl.cafile="C:/wamp/cacert.pem"

  • 重启 Wamp 服务.

  • Restart Wamp services.