Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage path path not working in laravel 5 #7295

Closed
ivaaaan opened this issue Feb 6, 2015 · 20 comments
Closed

Storage path path not working in laravel 5 #7295

ivaaaan opened this issue Feb 6, 2015 · 20 comments

Comments

@ivaaaan
Copy link

ivaaaan commented Feb 6, 2015

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?

@overtrue
Copy link
Contributor

overtrue commented Feb 6, 2015

http://laravel.com/docs/5.0/configuration#after-installation

Permissions
Laravel may require one set of permissions to be configured: folders within storage require write access by the web server.

@ivaaaan
Copy link
Author

ivaaaan commented Feb 6, 2015

My storage/ folder is ok, laravel somehow requires an entry in /

@overtrue
Copy link
Contributor

overtrue commented Feb 6, 2015

Oh right.
Try reinstalling composer or sudo composer update?

@ivaaaan
Copy link
Author

ivaaaan commented Feb 6, 2015

If i run sudo composer update cache has been write in / and all be ok, but it's wrong way

@overtrue
Copy link
Contributor

overtrue commented Feb 6, 2015

What a headache... 😢

@GrahamCampbell
Copy link
Member

This belongs on the forums.

@SalahiAltinci
Copy link

If your project is missing "storage/framework/views" folder, you receive that error. You should create that folder and give sufficient permission to it.

@hpawe01
Copy link

hpawe01 commented Apr 21, 2015

+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 "/".

@adriano0488
Copy link

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',

@yekz
Copy link

yekz commented Jul 13, 2015

+1 @adriano0488 work to me

@gsolak
Copy link

gsolak commented May 2, 2016

+1 @adriano0488 . Thank you.

@ferrites
Copy link

work to me

@LF-DevJourney
Copy link

LF-DevJourney commented Aug 17, 2017

run sudo ./artisan config:cache in the application root path. not the repo path.

refer to laravel wrong path

@edalx
Copy link

edalx commented Oct 18, 2017

To test this you could disable SElinux temporally with the following command:
setenforce 0

@minhnguyenaduro
Copy link

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 fixed

@vhiyastra
Copy link

+1 @minhnguyenaduro . Thank you.

@sachoingit
Copy link

change name of file config.php to config.php_ in bootstrap/cache/config.php .

@rbhuman
Copy link

rbhuman commented Jul 5, 2018

Thank you sachoingit

@toocool
Copy link

toocool commented Oct 15, 2018

run sudo ./artisan config:cache in the application root path. not the repo path.

refer to laravel wrong path

This is very important for those who use vagrant (for example) to run artisan config:cache inside vagrant vm not from the macos terminal or whatever machine you are using

@vahidbn
Copy link

vahidbn commented Mar 12, 2020

change name of file config.php to config.php_ in bootstrap/cache/config.php .
tanx @sachoingit
it's worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests