简体   繁体   中英

Can't edit files after I run the composer-update command

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).

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM