我可以连接到SSL站点,通过HTTPS通过命令行安装作曲家。已检查OPENSSL版本SSL Version => OpenSSL/1.0.1j
。那么问题出在哪里呢?思潮?
这是原始输出。
[kunaaljain@localhost php]$ /opt/lampp/bin/php-5.6.3 composer.phar diagChecking composer.json: FAIL
the property name is required
the property description is required
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity: FAIL
[ComposerDownloaderTransportException] 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 open stream: Cannot connect to HTTPS server through proxy
Checking HTTP proxy: FAIL
[ComposerDownloaderTransportException] 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 open stream: Cannot connect to HTTPS server through proxy
这是 php> 5.6 的 OpenSSL 问题。Rob Allen在这里使用自制软件进行了修复:http://akrabat.com/ssl-certificate-verification-on-php-5-6/
在 github 上还有一个关于作曲家的官方问题:https://github.com/composer/composer/issues/2798#issuecomment-68200214
编辑你的 php.ini链接你的证书文件应该可以修复它:
curl.cainfo=/full/path/to/ssl/certs/ca-bundle.crt
openssl.cafile=/full/path/to/ssl/certs/ca-bundle.crt
这个问题告诉你如何找到正确的路径:从打包器更新时,作曲家更新失败
我更新到 OSX El Capitan 并在开发环境中同时更新其他内容后,我在 Mac 上遇到了同样的情况。
我花了半天时间进行调查,得出的结论是,原因是openssl的证书过时了。解决方案是通过bash脚本从Apple的钥匙串中提取证书:
cert_file="$( openssl version -d | awk -F'"' '{print $2}' )/cert.pem"
mkdir -p "${cert_file%/*}"
security find-certificate -a -p /Library/Keychains/System.keychain > "$cert_file"
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> "$cert_file"
在大多数情况下,如果openssl的配置之前没有手动搞砸,这应该会有所帮助。需要简单更新证书。
尝试在本地流浪环境中运行作曲家时,我遇到了同样的问题。发现问题是由系统时钟不同步引起的。
通过运行修复
vagrant ssh
sudo apt install ntpdate
sudo ntpdate ntp.ubuntu.com
sudo timedatectl set-ntp on
sudo service ntp stop
sudo ntpd -gq
sudo service ntp start