以前都在linux環境使用php composer。今天嘗試在win7下運行composer卻出現SSL報錯:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
D:\data\www\mmoyu\symapp>php -f %phprc%\composer install Loading composer repositories with package information [Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed Failed to enable crypto failed to open stream: operation failed install [--prefer- source ] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-p lugins] [--no-custom-installers] [--no-scripts] [--no-progress] [- v |vv|vvv|--ver bose] [-o|--optimize-autoloader] |
沒有安裝CA證書導致的!!!
CA證書下載地址:http://curl.haxx.se/docs/caextract.html
然後修改php.ini文件
1
|
openssl.cafile= D: /wamp/php/verify/cacert .pem |
就OK了~