Laravel 4: Error in exception handler after new install

After deploying on a new machine a Laravel 4 site I’m currently working on, whenever I pointed my browser to my public folder, I could only see the following:

Error in exception handler.

I checked couldn’t see any new log entry app/storage/logs/laravel.log which could point me at the cause of the problem. I first suspected that it might be an issue with the .htaccess file but it looked fine.

Finally, it’s the fact that nothing was written in there but some entries were written when I executed something from the command line earlier. The difference was just that this was all run with two different users. So it was working when my user was writing but not when the user used by the web server was writing.

Actually I had executed a chown just to avoid this kind of problem. Looking at the owner/group again, I saw that the owner was my user and the group was the _www group under which the web server was running. So the owner had the rights and the group not. So the solution was to run:

chmod -R g+w *

If you do not want to give the webserver write access to all files, well you got to think a little further. The problem was that the exception handler run into an error and no log entries were written, so the problem was probably that you needed access to the directory where the log files are stored. Actually, you only read read access to most directories. And the app/storage is probably one of the few exceptions. So all you need to solve the problem is to execute:

chmod -R g+w app/storage

After that, the web site was displayed properly. Actually I saw no other errors which would cause the exception handler to be called in the first place. I guess the problem which caused the original exception was also related to the storage directory not being writeable for the web server group.