Well, this error is so know but in my case I could not mitigate it in my side. I have migrated a laravel-4 installation to another server and for the first time accessed I get this error:
file_put_contents(/var/www/html/MyApp/app/storage/meta/services.json): failed to open stream: Permission denied
I have followed different googled aswers as below
- https://stackoverflow.com/a/17971549/1424329
- Can't make Laravel 4 to work on localhost
- http://laravel.io/forum/05-08-2014-failed-to-open-stream-permission-denied
- Laravel 4: Failed to open stream: Permission denied
However, any of them could not fix my problem. I also tried cleaning the cache and dump autoclass command:
php artisan cache:clear
chmod -R 777 app/storage
composer dump-autoload
Also, I have thought that the webserver process might be considered in the problem, so I seek for its user like this:
$ ps -ef|grep httpd
apache 11978 11976 0 11:14 ? 00:00:00 /usr/sbin/httpd -DFOREGROUND
Then, I added apache
to the directory group owner and the problems persists.
I do not know what else to do, I am going insane because dancing naked under full moon neither fixed the problem.