suPHP and Internal Server Erros (I've read EVERY thread! Still nothing!)

Lucas

Well-Known Member
Feb 22, 2003
132
3
168
Around the world
cPanel Access Level
Root Administrator
I'm running a VPS with CentOS 4.5 ,cPanel/WHM 11, Apache 2, PHP 5 and MySQL 4. I've done a compilation with suPHP and everything and enabled it but the scripts still get Internal Server Error. Tried deleting/creating the sites again and nothing. The log of suphp reads like this:

Code:
[Tue Dec 04 11:09:01 2007][Tue Dec 04 11:09:01 2007] [warn] File "/home/bio/public_html/forum/index.php" is writeable by group
[Tue Dec 04 11:10:57 2007] [warn] File "/home/bio/public_html/forum/install/install.php" is writeable by group
[Tue Dec 04 11:12:13 2007] [warn] File "/home/bio/public_html/forum/install/install.php" is writeable by group
[Tue Dec 04 11:12:14 2007] [warn] File "/home/bio/public_html/forum/install/install.php" is writeable by group
[Tue Dec 04 11:12:15 2007] [warn] File "/home/bio/public_html/forum/install/install.php" is writeable by group
[Tue Dec 04 11:12:28 2007] [warn] File "/home/bio/public_html/forum/install/install.php" is writeable by group
This is a completely new OS installation.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
I'm running a VPS with CentOS 4.5 ,cPanel/WHM 11, Apache 2, PHP 5 and MySQL 4. I've done a compilation with suPHP and everything and enabled it but the scripts still get Internal Server Error. Tried deleting/creating the sites again and nothing. The log of suphp reads like this:

Code:
[Tue Dec 04 11:09:01 2007][Tue Dec 04 11:09:01 2007] [warn] File "/home/bio/public_html/forum/index.php" is writeable by group
[Tue Dec 04 11:10:57 2007] [warn] File "/home/bio/public_html/forum/install/install.php" is writeable by group
[Tue Dec 04 11:12:13 2007] [warn] File "/home/bio/public_html/forum/install/install.php" is writeable by group
[Tue Dec 04 11:12:14 2007] [warn] File "/home/bio/public_html/forum/install/install.php" is writeable by group
[Tue Dec 04 11:12:15 2007] [warn] File "/home/bio/public_html/forum/install/install.php" is writeable by group
[Tue Dec 04 11:12:28 2007] [warn] File "/home/bio/public_html/forum/install/install.php" is writeable by group
This is a completely new OS installation.
On a SuPHP system, permissions should not be more than 755 as such permissions are unnecessary. That's precisely what the error messages are complaining about. Chmod down to 755 (or lower as appropriate) and it should stop throwing those errors :).
 

Lucas

Well-Known Member
Feb 22, 2003
132
3
168
Around the world
cPanel Access Level
Root Administrator
On a SuPHP system, permissions should not be more than 755 as such permissions are unnecessary. That's precisely what the error messages are complaining about. Chmod down to 755 (or lower as appropriate) and it should stop throwing those errors :).
All permissions are default, therefor not higher than 755. There has to be something else causing this issue, this is a complete new install and I believe the compilation was done correctly.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
All permissions are default, therefor not higher than 755. There has to be something else causing this issue, this is a complete new install and I believe the compilation was done correctly.
That seems to contradict the error message you presented. Have you checked the permissions of the file and verified this?
 

Lucas

Well-Known Member
Feb 22, 2003
132
3
168
Around the world
cPanel Access Level
Root Administrator
That seems to contradict the error message you presented. Have you checked the permissions of the file and verified this?
public_html = 750
forum = 755
install = 775 (Fixed to 755, still not working though. Also the index.php which is before the install folder isn't working either and all the permissions up to that file were correct.)
install.php = 664
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
public_html = 750
forum = 755
install = 775 (Fixed to 755, still not working though. Also the index.php which is before the install folder isn't working either and all the permissions up to that file were correct.)
install.php = 664
A problem I have encountered with some installers (namely the WordPress automatic upgrade plug-in) is that they may not be aware of SuPHP environments and thus change the permissions of the file to be group-writable and world-writable. Unfortunately (or fortunately depending on your perspective), SuPHP does not permit this and thus raises server 500 errors instead of executing (or allowing the inclusion of) these scripts.

So while the install script itself may have proper permissions, the other scripts it may call may not have the proper permissions, or you may set them to proper permissions only to have the installer change those permissions.

This is not a common issue in my experience of constantly tinkering with PHP scripts. However, it does crop up once in a great while.
 

sparek-3

Well-Known Member
Aug 10, 2002
2,059
236
368
cPanel Access Level
Root Administrator
public_html = 750
forum = 755
install = 775 (Fixed to 755, still not working though. Also the index.php which is before the install folder isn't working either and all the permissions up to that file were correct.)
install.php = 664
The install.php file needs to be set to 644.
 

Lucas

Well-Known Member
Feb 22, 2003
132
3
168
Around the world
cPanel Access Level
Root Administrator
Hmm, all files are 664 and indeed need to be 644, didn't notice! It's weird though that they were all automatically changed to that permission. Maybe because I uploaded a .zip from windows and unzipped it?

Thank you!
 
Last edited:

Lucas

Well-Known Member
Feb 22, 2003
132
3
168
Around the world
cPanel Access Level
Root Administrator
When untaring or unzipping some files are extracted with the incorrect file permissions. Any ideas why this is happening? Anyway to fix it? Folders are being extracted as 775 instead of 755.

When I created a directory through SSH it created it with permissions 777, why is this? Also extracted a phpbb.zip directly downloaded from their site and had some folders on 777. Is this normal or is it something that I must fix?

Regards
 
Last edited:

sparek-3

Well-Known Member
Aug 10, 2002
2,059
236
368
cPanel Access Level
Root Administrator
How are you extracting the files?

It could just be that those are the permissions of the file as the archive was created. Though if every archive you are extracting is doing this, then it could be something else.
 

Lucas

Well-Known Member
Feb 22, 2003
132
3
168
Around the world
cPanel Access Level
Root Administrator
How are you extracting the files?

It could just be that those are the permissions of the file as the archive was created. Though if every archive you are extracting is doing this, then it could be something else.
Using SSH unzip/tar respectively. It goes exactly like this:

1. Creating a dir through SSH makes it 777 permission which suPHP will not allow throwing an Internal Server Error.
2. Unziping or untaring also gives some folders with 777 or similar, not all though.
 

Lucas

Well-Known Member
Feb 22, 2003
132
3
168
Around the world
cPanel Access Level
Root Administrator
This should be 0022.

Type the command:

umask 022

Then try creating a file and creating a directory.

Are they set to 644 and 755 respectively?

Do you have root access to the server?
The number I gave you above was while I was logged into a normal user account with SSH access. The root server access gives me 0022.

Regards
 

sparek-3

Well-Known Member
Aug 10, 2002
2,059
236
368
cPanel Access Level
Root Administrator
This should be 0022.

Type the command:

umask 022

Then try creating a file and creating a directory.

Are they set to 644 and 755 respectively?

Do you have root access to the server?
 

sparek-3

Well-Known Member
Aug 10, 2002
2,059
236
368
cPanel Access Level
Root Administrator
Do the command:

umask 022

while logged in as the normal user, the one that is reporting 0002 as the umask.

What user are you logging in as?

Type:

id

while logged in as this normal user.

It will return something like:

uid=xxxxx(user) gid=yyyyy(group) groups=yyyyy(group)

What is the xxxxxx from this command?
 

Lucas

Well-Known Member
Feb 22, 2003
132
3
168
Around the world
cPanel Access Level
Root Administrator
Do the command:

umask 022

while logged in as the normal user, the one that is reporting 0002 as the umask.

What user are you logging in as?

Type:

id

while logged in as this normal user.

It will return something like:

uid=xxxxx(user) gid=yyyyy(group) groups=yyyyy(group)

What is the xxxxxx from this command?
Returned: 32003

Btw, after turning umask to 022 the folders created using mkdir were created as 755 and not 777. (Still would like to know how to have this fixed for any future created account, thank you.)
 

sparek-3

Well-Known Member
Aug 10, 2002
2,059
236
368
cPanel Access Level
Root Administrator
Is this a Linux server?

As root, take a look at the file:

/etc/bashrc

Near the top of the file, it should have something like:

Code:
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
        umask 002
else
        umask 022
fi
Does it?