"Writeable by group" exception for php scripts which are under git control

Lea Hayes picture Lea Hayes · Feb 6, 2014 · Viewed 7.7k times · Source

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?

Answer

hfmanson picture hfmanson · Dec 10, 2014

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