Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
229 views
in Technique[技术] by (71.8m points)

php - Write Privileges - localhost - Mac OSX

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-with-mysql-installer/

I've transferred my sites and databases and everything is going pretty well. The only problem I have is with the writing permissions. For example there is a config file that needs to be written to, and I had to right click, go to Get Info then enable read & write for staff and everyone.

I can't manually go through and enable these write privileges for every file/folder. I didn't need to do this using WAMP and made development much quicker.

So wondering about 2 possible solutions: a) add my user account to a whitelist for the localhost so that 644 privileges are sufficient b) set the write privileges recursively

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I found the best solution was to change the apache user and group settings. The instructions can be found at: http://paulmason.name/item/change-apache-user-group-in-lion-os-x

  1. Open Terminal and Enter

    sudo nano /private/etc/apache2/httpd.conf
    
  2. Find and change http.conf code from

    User _www
    Group _www
    

    To

    User your_mac_username
    Group staff
    

    Note: With earlier versions such as Leopard, capitalize staff to Staff. You can get your username and group by typing "id" and hitting enter in terminal

  3. Restart Apache

    sudo apachectl restart
    

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...