3

I am working on a website which is implemented using a number of PHP scripts. The entire website is a git repository which is running on a dedicated Apache server. The server will serve a website to the world but will not contain any reseller sub-accounts/reseller accounts.

After examining the error log I see the following:

SoftException in Application.cpp:256: File "/home/test/public_html/t.php" is writeable by group

It seems that the permission g+w is preventing PHP scripts from executing and simply throws a "500 Internal Server Error" page back to the web browser. Each time I pull from the git repository the scripts automatically acquire the permission g+x.

What should I do?

  1. Disable suEXEC? This doesn't seem to help.

  2. Is there a way to disable this "Writeable by group" requirement? would that even be sufficient?

  3. Somehow configure git to NOT add g+w permission?

  4. Something else?

pnuts
  • 58,317
  • 11
  • 87
  • 139
Lea Hayes
  • 62,536
  • 16
  • 62
  • 111
  • possible duplicate of [Retaining file permissions with Git](http://stackoverflow.com/questions/3207728/retaining-file-permissions-with-git) – Lajos Veres Feb 06 '14 at 19:06
  • @LajosVeres That question doesn't help me to resolve this problem. How would I need to configure git to not add the `g+w` permission? What do I do with all of the .php files in the project (i.e. wordpress, plugins, etc). I feel that this is a good quality question which applies to anybody who is struggling to setup a git workflow on a dedicated server. – Lea Hayes Feb 06 '14 at 19:11
  • 3
    Does setting umask to 022 work? I am assuming it's a linux system. – Russ Huguley Feb 06 '14 at 19:34
  • @RussHuguley Thanks, if I do that before calling `git pull` that seems to work perfectly. Perhaps I should create a shell script to ease this process. – Lea Hayes Feb 06 '14 at 20:20

1 Answers1

10

When running in CGI/FastCGI mode you should edit /etc/suphp/suphp.conf and change:

allow_file_group_writeable=true
allow_directory_group_writeable=true
hfmanson
  • 1,446
  • 14
  • 21