Reputation: 1
I have installed laravel in centos Server and I have Nginx webserver. so I gave permission in this manner:
sudo chown nginx:nginx -R laravel
sudo find /path/to/laravel/root/directory -type f -exec chmod 644 {} \;
sudo find /path/to/laravel/root/directory -type d -exec chmod 755 {} \;
I have a job that it should be execute every night. but it say me that Permission denied this is its error:
ErrorException: file_put_contents(/storage/framework/views/4c5ceab6c4a8a0145f0cbc6ee6ffbfc02a9f53c4.php): failed to open stream: Permission denied in /vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:122 Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_put_conten...', '/var/www/phpadm...', 122, Array)
What should I do?
Upvotes: 0
Views: 117
Reputation: 371
The permissions need to be 755 on the storage directory ensure that you're setting permissions recursively using -r flag.
Upvotes: 0