我可以连接到SSL站点,通过HTTPS通过命令行安装composer。已检查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
[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 open stream: Cannot connect to HTTPS server through proxy
Checking HTTP proxy: FAIL
[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 open stream: Cannot connect to HTTPS server through proxy发布于 2015-03-16 00:00:55
这是一个php > 5.6的OpenSSL问题。Rob Allen在这里用自制软件解决了这个问题:http://akrabat.com/ssl-certificate-verification-on-php-5-6/
github上还有一个针对Composer的官方问题: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这个问题告诉你如何找到正确的路径:Composer update fails while updating from packagist
发布于 2015-12-10 10:04:56
在我更新到OSX El Capitan之后,我在我的Mac上也遇到了同样的情况,同时在我的开发环境中更新了其他东西。
我花了半天的时间调查,得出的结论是openssl中有过时的证书。解决方案是通过bash脚本从苹果的密钥链中提取证书:
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的配置,那么这在大多数情况下都会有帮助。
发布于 2018-10-28 03:35:51
当我试图在本地的流浪环境中运行composer时,我也遇到了同样的问题。已找到系统时钟不同步导致的问题。
通过运行以下命令修复
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 starthttps://stackoverflow.com/questions/28249081
复制相似问题