3

I have successfully set up a Vagrant environment to put my laravel application with all its dependencies, as well as configuring the web server as required. I set this up using ubuntu.

The problem that I have is the app/storage folder. I noticed that the first time I loaded the site, it gave me an error with permissions. I then ran a:

chmod -R a+rwx app/storage 

... And that made me load my file properly. When I refreshed, I got a blank screen.

I ran chmod once again, and I had access to my mainpage once again.

I tested my routes only to come with the problem that my application randomly crashed. Running chmod yet again solved this.

I came to the conclusion that my problem is related with group ownership and not so much permissions themselves, because files are being created constantly on the app/storage folder and they are not being created with permissions.

How can I add write permissions to the app/storage folder so everytime new files are made, will have the permissions I need?

0

2 Answers 2

0

Try setting your config.vm.synced_folder as following in the Vagrantfile:

config.vm.synced_folder "/local/folder", "/vagrant/folder", :owner => 'vagrant', :group =>'www-data', :mount_options => ['dmode=775,fmode=775'] 
Sign up to request clarification or add additional context in comments.

3 Comments

Specifically for the storage folder? Or my overall storage folder? I am confused about the local and vagrant folders here. Do you mean something like this? " config.vm.synced_folder "src/app/storage", "/vagrant/app/storage", :owner => 'vagrant', :group =>'www-data', :mount_options => ['dmode=775,fmode=775']" ... When I do a git pull, I can do it from any folder pretty much. Does local have to be an absolute path like you illustrated?
I tried that and whilst I can mount the folder properly, I still have this issue
I have this line 1:1 with no changes and so it was working for me, maybe I'll be able to find some more ways of doing this.
-4

You must run chmod -R 755.

Hope this helps. Bye.

1 Comment

I tried this. If you read my question properly, you can see that I am essentially running this command over and over again. Running chmod works, but once I start browsing and calling the routes, more files are created.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.