dongqiu5184
2014-08-24 10:48 阅读 74
已采纳

运行composer-update命令后无法编辑文件

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

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    dsfsdf7852 dsfsdf7852 2014-08-24 10:55

    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

    点赞 评论 复制链接分享

相关推荐