I've been trying for the last hours to install Laravel 4 on my dreamhost account but I keep getting this error:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/user/test/artisan on line 46
Parse error: syntax error, unexpected T_STRING in /home/user/test/artisan on line 46
When I run
/usr/local/bin/php-5.4 -d memory_limit=256M composer.phar create-project laravel/laravel test
I've read that it may be because I use the wrong php version, but I've run the command above with
With the same result. Any ideas? Thanks in advance!
As mentioned by the answer from Sheikh Heera, the composer.phar must be run with PHP 5.3 or higher.
What has not been mentioned yet is that composer.json
contains several references to PHP binary. When installing Laravel in an environment where PHP defaults to a version lower than 5.3 (e.g. WebFaction servers), all references to "php" within file composer.json
must be changed to point to a newer version of PHP.
For example:
"post-install-cmd": [
"php artisan optimize"
],
... must be changed to (something like):
"post-install-cmd": [
"php54 artisan optimize"
],
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With