php – 无法通过ssh访问服务器下载composer – 1and1

前端之家收集整理的这篇文章主要介绍了php – 无法通过ssh访问服务器下载composer – 1and1前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有SSH访问我的1and1服务器.我正在尝试下载作曲家.

遵循http://getcomposer.org/download/的指示

尝试1:

  1. user:~ > curl -sS https://getcomposer.org/installer | PHP
  2. X-Powered-By: PHP/4.4.9
  3. Content-type: text/html
  4.  
  5. <br />
  6. <b>Parse error</b>: Syntax error,unexpected '{' in <b>-</b> on line <b>316</b><br />

尝试2:

  1. PHP -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
  2. Error in argument 1,char 2: option not found r
  3. Usage: PHP [-q] [-h] [-s] [-v] [-i] [-f <file>]
  4. PHP <file> [args...]
  5. -a Run interactively
  6. -b <address:port>|<port> Bind Path for external FASTCGI Server mode
  7. -C Do not chdir to the script's directory
  8. -c <path>|<file> Look for PHP.ini file in this directory
  9. -n No PHP.ini file will be used
  10. -d foo[=bar] Define INI entry foo with value 'bar'
  11. -e Generate extended information for debugger/profiler
  12. -f <file> Parse <file>. Implies `-q'
  13. -h This help
  14. -i PHP information
  15. -l Syntax check only (lint)
  16. -m Show compiled in modules
  17. -q Quiet-mode. Suppress HTTP Header output.
  18. -s Display colour Syntax highlighted source.
  19. -v Version number
  20. -w Display source with stripped comments and whitespace.
  21. -z <file> Load Zend extension <file>.

我做错了什么吗?

我知道它说我运行PHP 4.4.9,但如果我运行PHPinfo(),它说PHP版本5.4.21正在运行.关于这里发生了什么的任何建议?

PHPinfo()函数

PHP -v

目前1& 1提供了一堆不同别名的PHP版本.

但是,设置默认PHP版本的最简单方法是使用1& 1仪表板PHP设置,并逐个设置每个域.它位于Hosting下,然后是PHP设置. [1&1 PHP Settings (United States site)]

请注意,1and1现在非常定期更新PHP版本,并且CLI版本可能与呈现站点的一个用户不同.

原始答案.已经很久了,我建议使用最新的7.x.
实际上在所有1and1 linux共享主机上预装了4个版本的PHP.

命令:

> PHP:4.4版(你实际上和作曲家一起使用的那个.)
> PHP5:版本5.2
> PHP5.5:版本5.5
> PHP6:版本5.4

你必须使用PHP5.5调用composer,它才会起作用.

猜你在找的PHP相关文章