Cannot download composer - 1and1 with ssh access to server(无法通过 ssh 访问服务器下载 composer - 1and1)
问题描述
我可以通过 SSH 访问我的 1and1 服务器.我正在尝试下载作曲家.
按照 ]
请注意,现在 1and1 会定期更新 PHP 版本,而且 CLI 版本可能与呈现您网站的用户不同.
原答案.久违了,推荐使用最新的7.x.
实际上所有1and1 linux共享主机上都预装了4个版本的php.
命令:
php
:4.4 版(您实际与 composer 一起使用的那个.)php5
:版本 5.2php5.5
:5.5版php6
:5.4 版
您必须使用 php5.5 调用 composer,它才可以工作.
I have SSH access to my 1and1 server. I am trying to download composer.
Following instructions from http://getcomposer.org/download/
Attempt 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 />
Attempt 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>.
Am I doing something obviously wrong?
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
Currently 1&1 offers a bunch of PHP versions under different aliases.
However the easiest way to set a default PHP version to use is from your 1&1 dashboard PHP settings and set it per domain individually. This is located under Hosting and then PHP settings. [1&1 PHP Settings (United States site)]
Note that 1and1 updates the PHP versions now quite regularly and also the CLI version may differ to the one user to render your site.
Original answer. It's been a long time, I recommend using the the latest 7.x.
There actually are 4 versions of php preinstalled on all the 1and1 linux shared hosting.
Command:
php
: Version 4.4 (The one you're actually using with composer.)php5
: Version 5.2php5.5
: Version 5.5php6
: Version 5.4
You have to invoke composer using php5.5 and it will just work.
这篇关于无法通过 ssh 访问服务器下载 composer - 1and1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法通过 ssh 访问服务器下载 composer - 1and1
基础教程推荐
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 在多维数组中查找最大值 2021-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01