Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've set up a web server on OS X Mountain Lion (not the server version) what is working perfectly. The problem I am having is that if I edit a PHP file in the server document directory from another machine on the network then it's permissions are altered such that Apache can no longer read the file and I have to go back to the server and alter the files permissions. I've spent a couple of days trying to fix this but have so far failed.

I'm using PHP Storm on the Windows client machine and have set up ACL's on the server. I believe the problem may be that - when I save the file in PHP Storm - it creates a temporary file then deletes the old one and renames the temp file.

Can anyone help as this is getting frustrating.

share|improve this question

migrated from stackoverflow.com Nov 12 '12 at 20:59

This question came from our site for professional and enthusiast programmers.

    
did you set priviledges with chmod -R 777 yourDirectory/? –  toxicate20 Nov 12 '12 at 12:29
    
Thanks for responding. I've done that but as soon as I save the file from the client the permissions change from "-rwxrwxrwx+ 1 my_admin_name _www" to "-rw-------+ 1 my_user_name_on_client _www". –  user1818027 Nov 12 '12 at 12:42
    
can you tell me who is the owner of the folder that you are working on and who is the owner of the file that was edited. use 'ls -l' and look at the group. maybe the problem is that after editing the owner is set to root and therefore cant be edited –  toxicate20 Nov 12 '12 at 13:09
    
The owner of the directory is my admin name and the group is "_www". I set the group myself when I couldn't get Apache to read the directory at all. –  user1818027 Nov 12 '12 at 13:43
add comment

1 Answer

Perhaps this will help; in PHP Storm, select

  1. Preferences ⇨ General
  2. Uncheck Use “safe write” (save changes to a temporary file first)
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.