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 on vps giving 500 Error

Discussion in 'General Discussion' started by compuhost, Aug 24, 2011.

  1. compuhost

    compuhost Member

    Joined:
    Aug 19, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Hello:
    Im having a slight issue with the php handler.
    I have a VPS that I would like to use suphp for my php 5 handler.

    Last night I installed imagemagick and Imagick on the VPS.
    I cant remember if I had suphp set before I installed IM or not....

    No php files will work with the handler set at suphp.
    Not even the phpinfo.php will show.
    I just get a 500 error.

    All php files work with DSO.

    This is the Apache log file...
    Can anyone make any since out of this...
    I'm completely new at this stuff.. so please bare with me.. and thanks for helping.

    Matthew
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello Matthew,

    Ensure the file is 644 for file permissions and owned by autoraci:autoraci

    Code:
    ls -lah /home/autoraci/public_html/index.php
    Under suPHP, the files must not have permissions higher than 644 and folders must not have permissions higher than 755. The file must be owned by the user's uid and gid. Under DSO, files run as the group nobody, so autoraci:nobody might be what is set on the file.
     
  3. compuhost

    compuhost Member

    Joined:
    Aug 19, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Previously I ran the script that changed every file / folder to 644 / 755.
    I just double check file permissions and this is correct.

    Im not sure how I check who the file is owned by.
    I uploaded all files via FTP under the autoraci account.

    Thanks for helping me with this....
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    I provided the command in root SSH to run to check the permissions and ownership in my prior reply.
     
  5. compuhost

    compuhost Member

    Joined:
    Aug 19, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    It appears to me that autoraci owns the file.....

     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The folder it is in definitely has 755 file permissions as well?

    Code:
    ls -ld /home/autoraci/public_html/53chevy
    Next, what about public_html folder?

    Code:
    ls -ld /home/autoraci/public_html
    Also, do you have any .htaccess files in /home/autoraci/public_html and /home/autoraci/public_html/53chevy locations? If so, please provide the contents for those files. If you have php_value or php_flag entries in either location, it will throw a 500 Internal Server Error as well.
     
  7. compuhost

    compuhost Member

    Joined:
    Aug 19, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    53chevy folder
    public_html
    There is no contents in any .htaccess files


    I found and error_log file in the 53chevy folder...
    I will see if I can disable eAccelorator somewhere

     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Can you also set public_html to 750 for that top level? That's the typical setting for that level of public_html:

    Code:
    chmod 750 /home/autoraci/public_html
    To uninstall EAccelerator, you can do the following:

    Code:
    /scripts/phpextensionmgr uninstall EAccelerator
    Please also check that php.ini either on that account or at /usr/local/lib/php.ini doesn't have any empty extension = line:

    Code:
    grep ^extension /usr/local/lib/php.ini
     
  9. compuhost

    compuhost Member

    Joined:
    Aug 19, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    ok i commented eaccelorator and ffmgeg form php.ini and its working somewhat now...
    no more 500 error.... some php errors now...

    I will proceed to figure this out now.. im thinking something with folder permissions now...

    thank you for your help..

    Matthew
     
  10. compuhost

    compuhost Member

    Joined:
    Aug 19, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Here is the result from : grep ^extension /usr/local/lib/php.ini

     
  11. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Try moving that session file out of /tmp so that it has to create a new one. The old one is likely owned by the wrong user due to the PHP handler change:

    Code:
    mv /tmp/sess_7867ef39a54c01b33f813e2cf9c198eb /root
     
  12. compuhost

    compuhost Member

    Joined:
    Aug 19, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    WOW....
    That fixed that problem...
    but this goes deep... seems like every corner I turn has more errors...
    Now it tells me...
    I will just have to go back to DSO for now...
    I dont know enough about this stuff yet to do this...
    I dont even know yet if it messed up anything else yet..........
     
  13. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You likely should use PHP 5.2 instead of PHP 5.3, since that message is probably due to switching from PHP 5.2 to PHP 5.3 rather than switching from DSO to suPHP
     
  14. compuhost

    compuhost Member

    Joined:
    Aug 19, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    thanks for your great support here.
    I understand that you don't have to help me at all.
    I am very grateful that you have though...

    If I change the handler to DSO, all the errors go away, and the php shows correctly.
    When I change the handler back to suphp, the errors show up again.
    Ive had PHP 5.3 on the server since I got it.

    The only thing Ive done is try to install FFMPEG and ImageMagick through WHMxtra.
    Neither of which worked.
    I had to manually install ImageMagick and Imagick last night.
    I recompiled apache to include exif and this is when I noticed the errors.
    But, I dont know if the handler was set as DSO or suPHP.
    After I recompiled I just selected the defaut options which was suphp.

    Matthew


    thank
     
  15. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,471
    Likes Received:
    199
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  16. compuhost

    compuhost Member

    Joined:
    Aug 19, 2011
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Sorry for the long delay.
    thanks again for your help.

    Here is the reason I found to be my problem.

    I had originally compiled apache with PHP 5.3 with eaccelorator and using DSO as the handler.

    All php was working fine on the server.

    After doing research I found that it was best to use suphp as the handler.
    So I just changed the handler to suphp.

    Here's the thing.... I use Softalculous to install scripts on the server... just a laziness on my part I guess.

    Well ... it seems like that it must check what handler you are using and change the code or something if it needs to. So I originally installed Plogger with the DSO Handler, and when I changed it to suphp, plogger went crazy with the errors.

    I reinstalled plogger with the suphp handler, it gave me the write errors... that you helped me solve..
    When I changed back to DSO, is when it started to give me the deprecated error.

    So what I ended up doing was recompiling Apache with PHP 5.2, disabling eAccelorator, and using suphp for the handler. I removed all instances of plogger... and installed a fresh copy, using Softaculous.

    All is working fine now using suphp.
    Other scripts on the other account all seem to be working fine also.

    I will try later to recompile with php 5.3 and see if it continues to work.

    Thanks for helping me out here with this.
    Ive learned a bunch about PHP and how it works, what the server does for php, and why its important to secure your server.

    Godspeed,
    Matthew
     
Loading...

Share This Page