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

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了php – 无法通过ssh访问服务器下载composer – 1and1脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我有SSH访问我的1and1服务器.我正在尝试下载作曲家.

遵循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 4.4.9,但如果我运行PHPinfo(),它说PHP版本5.4.21正在运行.关于这里发生了什么的任何建议?

PHPinfo()函数

PHP -v

目前1&amp; 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 – 无法通过ssh访问服务器下载composer – 1and1全部内容,希望文章能够帮你解决php – 无法通过ssh访问服务器下载composer – 1and1所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。