I was playing around with a working Laravel 4 installation and moved everything into a sub folder. Then I decided to not do that and I moved it all back (all via the command line):
mv * /folder
and then
cd folder
mv * ../
Now, the site is throwing the following error:
file_put_contents(/var/www/quantquote/app/storage/meta/services.json): failed to open stream: Permission denied
Here is a screenshot of the full error:
http://i.imgur.com/8deGG97.png
I've already tried setting permissions on the /storage folder to 777 to no avail.
When chmod 777 or chmod 775 fails check that subdirectories really exists:
in case these folders does not exists you must to create it:
UPDATE 2016
In a default Laravel 5 application structure,
storage
is at the same level thanapp
. So the previous command becomes:https://laravel.com/docs/5.0/structure
Try these commands one by one:
Never run a 777, in recursive mode. It's a security issue. For now, remove the services.json file, and try this :
Laravel 4: Failed to open stream: Permission denied
just type this on terminal:
Spent a whole day for solving this and this command simply solved my problem.
If your permissions are 777 for Laravel App folder and you still get this error, it's because SEliux has blocked it. You can easily unblock your application's folder using this command:
su -c "chcon -R -h -t httpd_sys_script_rw_t /usr/share/nginx/YOUR_LARAVEL_APP/"
That's it!
BTW never disable SElinux: http://stopdisablingselinux.com/
As I stated in my comment:
find app/storage -type d -exec chmod 777 {} \;
find app/storage -type f -exec chmod 777 {} \;
This will chmod all directories and files in
app/storage
to 777.