php cURL error 60

使用命令new来创建Symfony项目"symfony.framework"

php symfony new symfony.framework

一般会有这个错误:

[GuzzleHttp\Exception\RequestException]
cURL error 60: SSL certificate problem: unable to get local issuer certificate
[GuzzleHttp\Ring\Exception\RingException]
cURL error 60: SSL certificate problem: unable to get local issuer certificate

解决方案:

1.下载 cacert.pem

https://curl.haxx.se/ca/cacert.pem

2.在php.ini里面加上这个:

curl.cainfo = "[pathtothisfile]\cacert.pem"
如:

curl.cainfo = "D:\phpStudy\php55n\cacert.pem"

3.重新使用命令new来创建Symfony项目

php symfony new symfony.framework

此时创建成功!

测试:

$ php bin/console server:run

 [OK] Server listening on http://127.0.0.1:8000

 // Quit the server with CONTROL-C.
php cURL error 60_第1张图片
image.png

你可能感兴趣的:(php cURL error 60)