欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

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

程序员文章站 2022-05-26 07:50:55
...
转自:http://my.oschina.net/yearnfar/blog/346727

今天尝试在win7下运行composer却出现SSL报错:

?

1234567891011121314D:\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: SSLoperation failed with code 1. OpenSSL Error messages:error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verifyfailedFailed to enable cryptofailed to open stream: operation failedinstall [--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文件

?

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

就OK了~

以上就介绍了解决Win7下运行php Composer出现SSL报错的问题,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。