解决Win7下运行php Composer出现SSL报错的问题

以前都在linux环境使用php composer。今天尝试在win7下运行composer却出现SSL报错:


D:\data\www\mmoyu\symapp>php -f %phprc%\composer installLoading 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-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader]


没有安装CA证书导致的!!!

CA证书下载地址:http://curl.haxx.se/docs/caextract.html。

然后修改php.ini文件

openssl.cafile= D:/wamp/php/verify/cacert.pem

在Windows8.1环境上,不知道问什么按照上面说的一直不行,

最后安装CA证书后,就可以了。具体CA证书的安装见:http://wenku.baidu.com/link?url=Wf7uOfdfUsthc7U8CpiOX7vGhmm3vlkMDt00KoNzJ6G_gMGj3X-YpnS72HGY62_-xxiS4ZXf2UhgGKwXMixKa0B8hqtvTsq-Zk7QsoDL0n3

就OK了~


你可能感兴趣的:(PHP,ssl,Composer)