无法通过ssh访问服务器下载composer - 1and1 [英] Cannot download composer - 1and1 with ssh access to server

查看:388
本文介绍了无法通过ssh访问服务器下载composer - 1and1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有SSH访问我的1and1服务器。我正在尝试下载作曲家。

I have SSH access to my 1and1 server. I am trying to download composer.

按照 http: //getcomposer.org/download/

尝试1:

user:~ > curl -sS https://getcomposer.org/installer | php
X-Powered-By: PHP/4.4.9
Content-type: text/html

<br />
<b>Parse error</b>:  syntax error, unexpected '{' in <b>-</b> on line <b>316</b><br />

尝试2:

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

我做错了明显错误吗?

PHP版本5.4.21 正在运行。关于这里发生什么的任何建议?

I know that it is saying that I am running php 4.4.9, but if I run phpinfo(), it says PHP Version 5.4.21 is running. Any suggestions on what is going on here?

phpinfo()

php -v

推荐答案

实际上有4个版本的php预装在所有的1and1 linux共享主机上。

There actually are 4 versions of php preinstalled on all the 1and1 linux shared hosting.

命令:

php ------->版本4.4(您实际上在使用作曲家的版本。)

php5 ----->版本5.2

php5.5 - >版本5.5
$ $ $ b php6 ----->版本5.4

php-------> Version 4.4 (The one you're actually using with composer.)
php5-----> Version 5.2
php5.5--> Version 5.5
php6-----> Version 5.4

您必须使用php5.5调用composer

You have to invoke composer using php5.5 and it will works.

尊敬

这篇关于无法通过ssh访问服务器下载composer - 1and1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆