0

How to setup Storage directory permission for Laravel 4. Im having this error:

`Error in exception handler: The stream or file "/var/www/mysite/app/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in /var/www/mysite/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:84`    

I already chmod -R the storage directory to 777. The problem still persist. Any ideas?

Laerte
  • 7,013
  • 3
  • 32
  • 50
hellilyntax
  • 157
  • 4
  • 13
  • Did you recursively `chmod`? `sudo chmod 777 -R storage` – James Mar 06 '16 at 07:01
  • yes, confirmed. everything go green: drwxrwxrwx. 2 apache apache 45 Mar 6 06:42 logs – hellilyntax Mar 06 '16 at 07:06
  • See this, looks similar http://stackoverflow.com/questions/23411520/error-laravel-log-could-not-be-opened – James Mar 06 '16 at 07:25
  • ok, i found that this also happen to joomla. i can't write to configuration.php. it has something to do with webserver user previlege. by the way, im using CentOS 7, which apache as web user. Will try to look on this matter. – hellilyntax Mar 06 '16 at 11:50
  • finally, it CentOS problem with SELinux. here is the solution: https://blog.lysender.com/2015/07/centos-7-selinux-php-apache-cannot-writeaccess-file-no-matter-what/ – hellilyntax Mar 06 '16 at 12:03

1 Answers1

0

It has nothing to do with Laravel or Google Compute Engine. It SELinux configuration which is comes with Centos 7. Have to tweak or disable SELinux to overcome this problem.

hellilyntax
  • 157
  • 4
  • 13