在 Raspbian Jessie 上安装 Composer 失败

Installation of Composer on Raspbian Jessie failed

按照 composer-website 上的安装指南进行操作后

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');"

PHP 似乎停止工作了。几分钟后,我用 Ctrl+C 取消了。

对 curl 进行了相同的尝试,但出现以下错误:

pi@rasppi-09:~ $ curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
All settings correct for using Composer
PHP Warning:  file_get_contents(https://getcomposer.org/versions): failed to open stream: Connection timed out in - on line 762
PHP Warning:  Invalid argument supplied for foreach() in - on line 508
None of the 0 stable version(s) of Composer matches your PHP version (5.6.24-0+deb8u1 / ID: 50624)

据我所知,有点超时,但实际上我不知道为什么。我正在为 HTTP/S 和 FTP 使用代理,但它对其他东西来说完美无缺。

有点像代理问题,php 没有使用定义的代理。

感谢 Mirdrack(见评论),我用 wget 做到了。