Laravel: running mastering gives me the error "Unexpected character when typing"

When I run php artisan list in my production environment (Debian Linux, private server), I get the following error:

 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/user/app/artisan on line 46 Parse error: syntax error, unexpected T_STRING in /home/user/app/artisan on line 46 

Why is this and how can I fix it?

+4
source share
1 answer

So, there is a parsing error on this line:

 $artisan = Illuminate\Console\Application::start($app); 

The PHP parser did not expect there \ which is used for namespaces that were introduced in PHP 5.3, which means restart the old version of PHP. You must upgrade your PHP installation to a minimum of PHP 5.3.

My hosting company has PHP 5.2 and 5.3 installed, so I just run:

 /usr/local/php53/bin/php artisan migrate 
+8
source

All Articles