Question

I have tried to start installing composer using each of these

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

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

But both give me

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

Anyone seen this before?

I'm running Linux 3.1.9-vs2.3.2.5vs2.3.2.5+ and PHP 5.2.17 (cli)

Was it helpful?

Solution

You are using a php command line version that does not understand namespaces: 5.2.17. Composer can only run with PHP 5.3 and up.

Note that that version you run on the command line need not have anything to do with the PHP you are using in the web server itself. It usually is a different executable with it's own configuration.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top