当我尝试composer install
或composer update
时,收到一条错误消息,指出无法验证SSL证书。
[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 ver
ify failed
Failed to enable crypto
failed to open stream: operation failed
有人知道如何解决这个问题吗?
答案 0 :(得分:0)
我自己没有遇到过这种情况,但经过快速搜索后,我发现了一个潜在的解决方案(如果您使用的是PHP 5.6):
# update the ports tree (software list)
$ sudo port -v selfupdate
# install php (shortcut for compiling php with our required libs)
$ sudo port install php56
# install the mcrypt library for php
$ sudo port install php56-mcrypt
# install the curl library for php
$ sudo port install php56-curl
# configure which php version your system should use
$ sudo port select php php56
来源:https://github.com/composer/composer/issues/2798(此问题还有其他可能的解决方案。希望有所帮助!