我正在尝试使用以下命令安装 Composer:
sudo curl -s https://getcomposer.org/installer | php
我收到了这个错误:
All settings correct for using Composer
Downloading...
Download failed: failed to open stream: Permission denied
Downloading...
Download failed: failed to open stream: Permission denied
Downloading...
Download failed: failed to open stream: Permission denied
The download failed repeatedly, aborting.
我不知道为什么?你有想法吗?我试着用谷歌搜索,但一无所获。
答案1
您的 curl 命令以 root 身份运行(通过 sudo),但您的 php 命令却不是。尝试将 sudo 移到管道(“|”)和“php”之间(假设您希望您的安装程序首先以 root 身份运行...)。