在尝试在 Windows 上设置 php 环境(使用 wamp)以使用 Amazon PHP SDK 时,当我尝试运行示例测试时出现以下错误:
Fatal error: Uncaught exception 'cURL_Exception' with message 'cURL resource: Resource id #10; cURL error: SSL certificate problem: unable to get local issuer certificate (cURL error code 60). See http://curl.haxx.se/libcurl/c/libcurl-errors.html for an explanation of error codes.' in C:\wamp\www\AWSSDKforPHP\lib\requestcore\requestcore.class.php on line 848
我已经在我的 php.ini 中添加了以下行
curl.cainfo = C:\Windows\ca-bundle.crt
这是我使用此 VBS 脚本创建的证书的位置 VBS-Script
我也重新启动了我的 WAMP 服务。
最佳答案
使用此证书根证书包:
https://curl.haxx.se/ca/cacert.pem
将此证书包复制到您的磁盘上。并在 php.ini
curl.cainfo = "path_to_cert\cacert.pem"
关于PHP cURL 错误代码 60,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21114371/