我正在尝试在 Ubuntu 16.04
中使用 PHP 版本 5.6.*
安装 Composer。
我使用:curl -sS https://getcomposer.org/installer | php
.但它给我错误如下:
All settings correct for using Composer
Downloading...
The "https://getcomposer.org/versions" file could not be downloaded: failed to open stream: Connection refused
Retrying...
The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
Retrying...
The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
The download failed repeatedly, aborting.
我之前没有安装 Composer。
最佳答案
我通过下载https://curl.haxx.se/ca/cacert.pem解决了这个问题并在我的 etc/php/5.6/cli/php.ini
和 etc/php/5.6/apache2/php.ini
中给出它的路径。
然后运行 sudo service apache2 restart && sudo apt installcomposer
就可以正常工作了。
关于php - Composer 安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48241939/