php artisan just returns the command line instantly if I run my site in production mode
I have a site on a live server that worked fine and then a few months due to some change that I am unaware of php artisan stopped working. Any command at all from simply "php artisan" to something more advanced does the same thing; in all cases the cursor just returns a new line almost instantly.
I've just discovered something that makes this maybe a bit easier to troubleshoot and that is why I'm creating this post.
I discovered today that if I set the APP_ENV variable in the .env file to "local" that it suddenly it will work again. This has gotten me around my biggest problem as this means that I can actually use the command to undertake some important work I needed to.
However it's still really annoying that it isn't working when the site is in the correct APP_ENV=production mode and each time I want to run a cache clear I first have to update the .env and set it to local.
I've tried composer install / update commands but this doesn't help.
Does anyone have any ideas to assist troubleshooting this ?
Like someone else, it was my own making this error. I had some logic deeply hidden checking
if (app()->environment('production')){ }
and it had an exit; clause if this was met. So in case anyone else gets it, do triple check your own code as it seems likely that somewhere you're probably shooting yourself in the foot ;)