laravel : php artisan suddenly stop working

谁说我不能喝 提交于 2019-12-11 02:38:11

问题


I know that there bunch of questions out there but mine doesn't seems fit in any.

I am working on laravel. php artisan was working fine an hour before. After that i just created a controller, a model and few views blade.

Now artisan simply won't work and no error at all. Even php artisan --version won't show anything.

I DIDN'T do any major changes like composer install, or update or install any new package. Neither any server configuration. It was just basic coding on controller , model and views.

Not sure what is causing this. What could be the reason and how shall i start debugging it?


回答1:


Artisan is an integrated part of Laravel, meaning it's using a console Application instance to run a command, and it will stop execution for errors which may come from any part of your application.

Syntax errors can be a common culprit that will stop artisan from working, and if debugging is not enabled errors are not displayed (just logged) so you get no output when running a command.

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

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.




回答2:


In my case, there were no problems with files and syntaxes. But when I reinstalled the dependencies it worked.

composer install

run above command in your working directory and it worked.



来源:https://stackoverflow.com/questions/36520323/laravel-php-artisan-suddenly-stop-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!