2015年9月19日 星期六

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

![Alt text](http://3.bp.blogspot.com/-0uttRx5fnv4/Vfz6TCVtEhI/AAAAAAAANqc/D6DN3Ys8nGY/s1600/Image%2B2.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 ``` 就可以正常運作了