framework: Storage path path not working in laravel 5
I’m clone laravel 5 project from my repo run composer update
and get error:
file_put_contents(/e59b9a8e34ca54e024d88970cf3bac09): failed to open stream: Permission denied
.
Why use path/
, why not /storage/framework/views
?
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 20 (4 by maintainers)
Because when you deploy, you push all config from your local to sever so some configuration will not be correct anymore Run
php artisan config:clear
It will be fixedchange name of file config.php to config.php_ in bootstrap/cache/config.php .
If your project is missing “storage/framework/views” folder, you receive that error. You should create that folder and give sufficient permission to it.
+1 @SalahiAltinci Same applies to the “storage/framework/sessions” folder… I think that’s a bug and laravel should create those folders automatically if they don’t exist, instead of taking an empty path and trying to perform “file_put_contets()” on “/”.
What a headache… 😢
To test this you could disable SElinux temporally with the following command:
setenforce 0
I’ve had this problem. The cause is the folder 'storage / framework / views ", this folder is set in config / views.php. This configuration file uses the realpath function (http://php.net/manual/en/function.realpath.php ) to get the absolute path if the folder does not have the appropriate permissions or does not exist, the function returns false.
The result will be: file_put_contents (false “/ e59b9a8e34ca54e024d88970cf3bac09.”), Which will cause the error.
Try to fix the permissions in folder (recommended) or change config/views.php in :
From: ‘compiled’ => realpath(storage_path().‘/framework/views’)
To: ‘compiled’ => storage_path().‘/framework/views’,
run
sudo ./artisan config:cache
in the application root path. not the repo path.refer to laravel wrong path