2015年9月19日 星期六

cURL error 60: SSL certificate problem: unable to get local issuer certificate

![Alt text](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinE8PbXmRzH1srPLp3BbrAwyuMCcC4FeDkwFxq14m3nRX540JhHTWveaBg3QBUrn3vl4Zrzs20koBH7t8gEGyZDKWczCyzzFfXOJFhOXHIHT5dljDaiUfk2CmIyZNMWOdxQYd09QMWrwaR/s1600/Image+2.png) 在使用Guzzle時,遇到cURL error 60: SSL certificate problem: unable to get local issuer certificate 只要下載[ca-bundle.crt](https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt)並放到相對應的路徑 ```php [ // Red Hat, CentOS, Fedora (provided by the ca-certificates package) '/etc/pki/tls/certs/ca-bundle.crt', // Ubuntu, Debian (provided by the ca-certificates package) '/etc/ssl/certs/ca-certificates.crt', // FreeBSD (provided by the ca_root_nss package) '/usr/local/share/certs/ca-root-nss.crt', // OS X provided by homebrew (using the default path) '/usr/local/etc/openssl/cert.pem', // Google app engine '/etc/ca-certificates.crt', // Windows? 'C:\\windows\\system32\\curl-ca-bundle.crt', 'C:\\windows\\curl-ca-bundle.crt', ]; ``` 如果再無法正常運作的話就得去修改php.ini 再加入 ```ini [curl] curl.cainfo=C:\Windows\curl-ca-bundle.crt [openssl] openssl.cafile=C:\Windows\curl-ca-bundle.crt ``` 就可以正常運作了

沒有留言:

張貼留言