My client says he is getting this error using my script:
Warning: Unexpected character in input: \'\\\' (ASCII=92) state=1 in /path/to//header.php on line 3
If you get 'unexpected T_STRING' error after your mentioned error, you need to install PHP 5.4+
Ask him to create a file with phpinfo()
. He probably doesn't have PHP version >= 5.3.0.
<FilesMatch "\.(inc|php|php3|php4|php44|php5|php52|php53|php54|php55|php56|phtml|phps)$">
AddHandler x-httpd-php53 .php
</FilesMatch>
in .htaccess
This happens if you are trying to use namespaces but do not have PHP 5.3. PHP 5.2 and below don't support namespaces and throw this error when they see the backslash.
-- Edit: mixed up the versions. It's 5.2 and below that don't have namespaces, if I'm not mistaken.
Now, I told him he has to have PHP >= 5.3.0 and he says his PHP version is 5.3.24
What could be the problem?
His PHP version is actually < 5.3.0, whether he knows that or not.
See the error occurring on many PHP versions.
I ran the same problem, and doing some research I managed to fix it.
In my case, I use PHP7, and what I had to do is edit the file laravel located in ~/.composer/vendor/laravel/installer/
, where the shebang line was #!/usr/bin/env php
I changed to #!/usr/bin/env php7
After run again the artisan, I got it working:
-bash-3.2$ laravel
Laravel Installer version 1.3.3
Usage:
command [options] [arguments]
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Available commands:
help Displays help for a command
list Lists commands
new Create a new Laravel application.