Write Privileges - localhost - Mac OSX

前端 未结 5 1790
北荒
北荒 2020-12-07 11:47

I\'m new to the mac world and have just been setting up my webserver. I used the following guide: https://alan.ivey.dev/posts/2011/os-x-10.7-lion-development-native-mamp-wit

5条回答
  •  失恋的感觉
    2020-12-07 12:33

    I'm running Apache on OSX and this fixed it for me:

    sudo chown -R _www:_www 
    sudo chmod -R 775 
    

    Update #1:

    Syntax: sudo chown : . The Apache user on OSX is _www.

    To keep ownership but give Apache r-w-x permissions:

    sudo chown -R :_www 
    sudo chmod -R 775 
    

    Update #2:

    I like this method best. Set Apache to run as you.

    1. In terminal type id to get uid=123(Myname).

    2. Open /etc/apache2/httpd.conf and edit it to use your username.

      
         User Myname
         Group staff
      
      
    3. Back to terminal: sudo apachectl restart

提交回复
热议问题