安装Composer时出现语法错误?

jer*_*iuh 6 php linux command-line curl composer-php

我试图使用这些中的每一个开始安装composer

sudo -u myuser curl -sS https://getcomposer.org/installer | php

sudo -u myuser curl -s https://getcomposer.org/installer | php -- --check

但是两个都给了我

Warning: Unexpected character in input:  '\' (ASCII=92) state=1 in - on line 381

Warning: Unexpected character in input:  '\' (ASCII=92) state=1 in - on line 386

Warning: Unexpected character in input:  '\' (ASCII=92) state=1 in - on line 402

Warning: Unexpected character in input:  '\' (ASCII=92) state=1 in - on line 640

Warning: Unexpected character in input:  '\' (ASCII=92) state=1 in - on line 688

Parse error: syntax error, unexpected T_SL in - on line 814
Run Code Online (Sandbox Code Playgroud)

有人见过这个吗?

我正在运行Linux 3.1.9-vs2.3.2.5vs2.3.2.5 +和PHP 5.2.17(cli)

Sve*_*ven 9

您正在使用不了解命名空间的php命令行版本:5.2.17.Composer只能运行PHP 5.3及更高版本.

请注意,您在命令行上运行的那个版本不需要与您在Web服务器本身中使用的PHP有任何关系.它通常是一个不同的可执行文件,它有自己的配置.