Reputation: 15
I create a project using this command (within htdocs):
sudo composer create-project laravel/laravel my-project --prefer-dist
Then I update the storage folder so that the site can run:
chmod -R 777 my-project/app/storage
But then when I go to edit any of the files it asks me to enter my Mac OSX password. I then need to chmod
the app folder as well but this doesn't seem correct.
How can I get it setup so that when I run the create-project command, the files are writable by my user? Or is this normal for laravel projects?
(I'm fine with running that command on the storage folder).
Upvotes: 0
Views: 250
Reputation: 800
Don't use sudo to create the project, sudo creates the project as the root user. If you can't do that with htdocs, you need to change the ownership of htdocs using sudo chown <you>:<group> <path to htdocs>
. This will allow you to create a project with your user credentials.
After this the only reason you might need to change the storage folder permissions/ownership is because your webserver will need access
Upvotes: 1