0

Hi I deploy my laravel4 script form my notebook to production on own VPS server with CentOS7 by git. I have problem with permission to storage folder. I obtain the error

 file_put_contents(/var/www/myweb/app/storage/views/0353b2081a97162a6d5fdda4c3a3f918): failed to 

open stream: Permission denied

i try change permission to storage directory by this by this

 cd app/ chown -R apache:apache storage cd storage/ find . -type d -exec chmod 775 {} \; && find . -type f -exec chmod 664 {} \; 

but the error is still same. How I must set permisiion for solve this problem on CentOS 7 ?

6
  • I was just thinking, have you checked if it has made the folder changes I normally use this command line to change write permission chmod –R 775 /var/www/yoursite/app/storage Commented Dec 13, 2014 at 18:26
  • the storage directory has owner apache:apache with permisiion 775 Commented Dec 13, 2014 at 18:30
  • 1
    Just to test, can you make it to 777 and test and let me know Commented Dec 13, 2014 at 18:32
  • yes with chmod -R 777 is now function. But this isnt safe? Commented Dec 13, 2014 at 18:36
  • now when I changed permission back to 775 is still function. The solutions from the link I before i wrote the question. Maybe is problem with deploy form git pull ? Commented Dec 13, 2014 at 18:53

1 Answer 1

1

It's an old post but still ...

It seem to be a selinux problem.

I installed my Laravel application in /opt/web/myapp and did all the steps mardon did. No luck.

Then I did sudo setenforce Permissive and it worked.

I'll be back with the proper selinux labels after a few tests.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.