0

I was making a controller while the server default localhost:8000 for laravel was on.

After making the controller the server was not working and when i tried command "php artisan serve" in terminal it gave me :-

[Symfony\Component\Debug\Exception\FatalErrorException]
parse error

What Should i do to make my project run again ?

Akshat Patni
  • 161
  • 1
  • 4
  • 10
  • Check `storage/logs/laravel.log` for details of the exception. Chances are your new controller has a parse error like a missing } or ; or something similar. – ceejayoz Jun 02 '16 at 20:23

3 Answers3

1

artisan commands will stop working when you've got this type of error somewhere in the app. Just find it (it seems there is one in a new controller), fix it and it will work.

Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279
  • Easiest way to find a parse error is to use IDE. Also, you can always look at Laravel error log. And read this: http://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them – Alexey Mezenin Jun 02 '16 at 20:22
1

Another thing to add to other answers, is to add -v to the artisan command you are using. This gives you a nice back trace, which helps finding possible bugs.

Like php artisan -v serve

vfsoraki
  • 2,186
  • 1
  • 20
  • 45
-2

I found out that it was due to a Syntax Error which can be found out by:

To search for syntax errors, go to your project directory and try linting the entire directory by running this command:

Command Here:-

find -L ./ -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l | grep "Errors parsing".

If any syntax errors are present, the command will output the first file that has an error, the line where it occurs and the error message.

Akshat Patni
  • 161
  • 1
  • 4
  • 10