作曲家更新在我的案例中不起作用

时间:2016-01-12 08:14:59

标签: php laravel laravel-5 composer-php

我在我的网站上安装了Laravel 5.0(通过FTP)。然后我尝试通过SSH连接并使用Composer进行更新。但是我收到了这个错误。 (我的PHP是5.5版本,我检查了phpinfo函数)。

PHP Notice:  Undefined index: argv in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 55
PHP Warning:  array_shift() expects parameter 1 to be array, null given in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 59
PHP Warning:  Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning:  Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning:  Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning:  Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning:  Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning:  Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning:  Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning:  Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning:  Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning:  Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285
PHP Warning:  Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285



  [ErrorException]                         
  Invalid argument supplied for foreach()  



X-Powered-By: PHP/5.3.28
Content-type: text/html

Warning: Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI

Notice: Undefined index: argv in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 55

Warning: array_shift() expects parameter 1 to be array, null given in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 59

Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285

Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285

Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285

Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285

Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285

Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285

Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285

Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285

Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285

Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285

Warning: Invalid argument supplied for foreach() in phar:///home/cluster-sites/58/kerimcaglar.com/laravel/composer.phar/vendor/symfony/console/Input/ArgvInput.php on line 285 

我控制了cli -v,我找不到这个命令。

后来我在下面尝试过:

$ php -d register_argc_argv=1 "./composer.phar" install

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - league/flysystem 1.0.16 requires php >=5.4.0 -> your PHP version (5.3.28) or value of "config.platform.php" in composer.json does not satisfy that requirement.
    - league/flysystem 1.0.16 requires php >=5.4.0 -> your PHP version (5.3.28) or value of "config.platform.php" in composer.json does not satisfy that requirement.
    - Installation request for league/flysystem 1.0.16 -> satisfiable by league/flysystem[1.0.16].

1 个答案:

答案 0 :(得分:2)

我怀疑这是一个重要的错误:

  

警告:应该通过PHP的CLI版本调用Composer,而不是cgi-fcgi SAPI

尝试which php查看PHP二进制文件指向的位置,然后locate bin/php查看您的系统的其他版本。

另请注意:

  

我的PHP是5.5版;我检查了phpinfo函数

有些人不同意你的意见:

  

X-Powered-By:PHP / 5.3.28

使用完全限定的路径尝试使用locate发现的PHP二进制文件的其他副本。例如:

/usr/bin/php55-cli composer.php update

如果这个主机有一个5.5 CGI二进制文件和一个5.3控制台二进制文件,他们可能不知道他们在做什么 - 这些天不再支持5.3。如果您自己没有运气修复,请创建一个支持服务单并要求php从shell调用5.5控制台二进制文件。

更新:在评论中的对话之后,看起来上面已修复了一个问题并暴露了另一个问题。新问题是您的Composer命令越来越远,并且它正在尝试再次调用使用php二进制文件的PHP帮助程序。这会导致原始问题(它是Web服务器二进制文件,它是5.3而不是5.5)。

要解决此问题,我建议您(a)创建一个本地php可执行文件以指向您想要的版本,然后(b)重置系统路径。我会在你的项目目录中尝试以下内容:

ln -s /usr/bin/php55-cli ./php
PATH=. ./php composer.phar update

这样做是创建一个指向所需PHP版本的符号链接,然后暂时将系统路径重置为当前目录。

如果这不能完全解决问题,您可能需要将符号链接放在一个更永久的位置(例如~/bin/php)并修改您的shell启动文件。请在填写之前尽量使用它它不起作用 - 学习如何独立完成这项工作的最佳方法是尝试!