php - Composer 安装失败

标签 php curl composer-php failed-installation

我正在尝试在 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.inietc/php/5.6/apache2/php.ini 中给出它的路径。

然后运行 ​​sudo service apache2 restart && sudo apt installcomposer 就可以正常工作了。

关于php - Composer 安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48241939/

相关文章:

php - 计算两个声音样本之间的差异

php - 处理类别和子类别 MySQL 或 JSON

java - 在 Java 程序中使用 curl

php - Composer - 不使用自动加载和加载单个类?

javascript - 将大表单数字从 javascript 转换为字符串

php - SEO 友好 URL 无效

json - 为什么curl会截断内容?

c# - 在 Web API 上取回 POST 数据

php - 如何在 MAMP 的 php 版本上运行 composer?

php - 使用 PHP GRPC Spanner Google Cloud 时出现错误