2014/01/13

File "something.php" is writeable by group on cPanel

On a cPanel system, if your php files are group writable, then you'll get HTTP 500 Internal Server Errors, and the following in /usr/local/apache/logs/error_log (not in the error_log in the documentroot):

SoftException in Application.cpp:256: File "/home/netfecom/subdomains/store/index.php" is writeable by group
Premature end of script headers: index.php
This check is silly, as cPanel uses user private groups. All the resources on google will tell you something like do a chmod g-w or change umask to 022. But the whole point of user private groups is to have the files group writable by default. So we need to change suphp behaviour. But unfortunately the config file is not anywhere where you would look for it, and searching for "configure suphp cpanel" leads to nothing. So the key information is that it can be found at /opt/suphp/etc/suphp.conf. These changes will do:
--- /opt/suphp/etc/suphp.conf.orig 2014-01-13 15:21:07.000000000 -0500
+++ /opt/suphp/etc/suphp.conf 2014-01-13 15:22:04.000000000 -0500
@@ -28,9 +28,9 @@
 
 
 ; Security options
-allow_file_group_writeable=false
+allow_file_group_writeable=true
 allow_file_others_writeable=false
-allow_directory_group_writeable=false
+allow_directory_group_writeable=true
 allow_directory_others_writeable=false
 
 

No comments:

Post a Comment