The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'General Discussion' started by Lucas, Dec 4, 2007.

  1. Lucas

    Lucas Well-Known Member

    Joined:
    Feb 22, 2003
    Messages:
    125
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    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.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    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 :).
     
  3. Lucas

    Lucas Well-Known Member

    Joined:
    Feb 22, 2003
    Messages:
    125
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Around the world
    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.
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    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?
     
  5. Lucas

    Lucas Well-Known Member

    Joined:
    Feb 22, 2003
    Messages:
    125
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Around the world
    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
     
  6. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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.
     
  7. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,383
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The install.php file needs to be set to 644.
     
  8. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Good catch :).
     
  9. Lucas

    Lucas Well-Known Member

    Joined:
    Feb 22, 2003
    Messages:
    125
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    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!
     
    #9 Lucas, Dec 4, 2007
    Last edited: Dec 4, 2007
  10. Lucas

    Lucas Well-Known Member

    Joined:
    Feb 22, 2003
    Messages:
    125
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    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
     
    #10 Lucas, Dec 4, 2007
    Last edited: Dec 4, 2007
  11. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,383
    Likes Received:
    23
    Trophy Points:
    38
    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.
     
  12. Lucas

    Lucas Well-Known Member

    Joined:
    Feb 22, 2003
    Messages:
    125
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Around the world
    cPanel Access Level:
    Root Administrator
    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.
     
  13. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,383
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Logout of SSH and log back in. The very first command that you type in this new session:

    umask

    what does that return?
     
  14. Lucas

    Lucas Well-Known Member

    Joined:
    Feb 22, 2003
    Messages:
    125
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Around the world
    cPanel Access Level:
    Root Administrator
    It returns "0002"
     
  15. Lucas

    Lucas Well-Known Member

    Joined:
    Feb 22, 2003
    Messages:
    125
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Around the world
    cPanel Access Level:
    Root Administrator
    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
     
  16. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,383
    Likes Received:
    23
    Trophy Points:
    38
    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?
     
  17. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,383
    Likes Received:
    23
    Trophy Points:
    38
    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?
     
  18. Lucas

    Lucas Well-Known Member

    Joined:
    Feb 22, 2003
    Messages:
    125
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Around the world
    cPanel Access Level:
    Root Administrator
    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.)
     
  19. Lucas

    Lucas Well-Known Member

    Joined:
    Feb 22, 2003
    Messages:
    125
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Around the world
    cPanel Access Level:
    Root Administrator
    Indeed. Should I change it to 022?
     
  20. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,383
    Likes Received:
    23
    Trophy Points:
    38
    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?
     
Loading...

Share This Page