Ubuntu

安裝作曲家失敗。無法訪問 http://

  • September 11, 2013

我正在嘗試使用以下命令安裝作曲家:

curl -s https://getcomposer.org/installer | php

我收到了這個錯誤:

PHP Warning:  Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0
#!/usr/bin/env php
Some settings on your machine may cause stability issues with Composer.
If you encounter issues, try to change the following:

Your PHP (5.3.2-1ubuntu4.18) is quite old, upgrading to PHP 5.3.4 or higher is recommended.
Composer works with 5.3.2+ for most people, but there might be edge case issues.

Downloading...
Download failed: Unable to access https://getcomposer.org/composer.phar
Downloading...
Download failed: Unable to access https://getcomposer.org/composer.phar
Downloading...
Download failed: Unable to access https://getcomposer.org/composer.phar
The download failed repeatedly, aborting.

任何的想法?

已解決:禁用 safe_mode 成功了!

我剛剛在我的身上試過:

[alexus@wcmisdlin02 ~]$ curl -s https://getcomposer.org/installer | php
#!/usr/bin/env php
Some settings on your machine may cause stability issues with Composer.
If you encounter issues, try to change the following:

Your PHP (5.3.3) is quite old, upgrading to PHP 5.3.4 or higher is recommended.
Composer works with 5.3.2+ for most people, but there might be edge case issues.

Downloading...

Composer successfully installed to: /home/alexus/composer.phar
Use it: php composer.phar
[alexus@wcmisdlin02 ~]$ php -v
PHP 5.3.3 (cli) (built: Jun 27 2012 14:13:03) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
[alexus@wcmisdlin02 ~]$ 

嘗試先更新您的 PHP 包,然後再試一次。

似乎您的端缺少一些 php 擴展,這是我端安裝的:

[alexus@wcmisdlin02 ~]$ rpm -qa | grep ^php
php-mysql-5.3.3-14.el6_3.x86_64
php-pear-1.9.4-4.el6.noarch
php-pecl-xhprof-0.9.2-5.el6.x86_64
php-gd-5.3.3-14.el6_3.x86_64
php-pear-Console-Color-1.0.3-1.el6.noarch
php-mbstring-5.3.3-14.el6_3.x86_64
php-pdo-5.3.3-14.el6_3.x86_64
php-common-5.3.3-14.el6_3.x86_64
php-soap-5.3.3-14.el6_3.x86_64
phpMyAdmin-3.5.4-1.el6.noarch
php-php-gettext-1.0.11-3.el6.noarch
php-xml-5.3.3-14.el6_3.x86_64
php-pecl-apc-3.1.9-2.el6.x86_64
php-pear-Console-Table-1.1.4-1.el6.2.noarch
php-mcrypt-5.3.3-1.el6.x86_64
php-cli-5.3.3-14.el6_3.x86_64
php-5.3.3-14.el6_3.x86_64
[alexus@wcmisdlin02 ~]$ 

引用自:https://serverfault.com/questions/469718