Composer安装失败了命令行

时间:2016-07-01 06:02:40

标签: composer-php cpanel

我似乎能够在CPanel上连接到SSH并运行安装程序,但访问“安装程序”失败,从而拒绝安装composer。有任何想法吗?

[mememigf@server188 home]$ wget https://getcomposer.org/installer
--2016-07-01 01:49:27--  https://getcomposer.org/installer
Resolving getcomposer.org... 87.98.253.108, 2001:41d0:a:7b19::2
Connecting to getcomposer.org|87.98.253.108|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 293630 (287K) [application/octet-stream]
installer: Permission denied

Cannot write to “installer” (Success).
[mememigf@server188 home]$ 

1 个答案:

答案 0 :(得分:0)

听起来你的主目录中已有一个名为" installer"的文件。你没有权限写信。

使用此命令测试是否属于这种情况

ls -l | grep installer

建议的作曲家安装方法如下

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

取自作曲家安装页面 https://getcomposer.org/download/