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.

500 Internal Server Error in all php pages

Discussion in 'EasyApache' started by rohan_, Jun 4, 2011.

  1. rohan_

    rohan_ Member

    Joined:
    Jun 4, 2011
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I just have installed cpanel/whm and i am having Internal server errors in all PHP files..

    What is wrong ? Please tell me a solution
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,474
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Sounds like a file permissions issue. IIRC, SuPHP is default on new cPanel installs. Did you restore a website to the server or something and file permissions are set incorrectly, possibly? You'll have to explain more I think for someone to help, just installing cPanel wouldn't do this.
     
  3. rohan_

    rohan_ Member

    Joined:
    Jun 4, 2011
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Some php files were working and some not..

    So I found this thread http://forums.cpanel.net/f34/500-internal-server-error-php-file-150233.html

    and I accesses my SSH and I put there "chown -R USERHERE:USERHERE /home/USERHERE/public_html"

    but after this all of my pages started showing forbidden page I also changed permissions but didn't work..

    Then i did this "chown -R USERHERE:nobody /home/USERHERE/public_html"

    Then all of my php pages started giving 500 internal server error..

    Then I changed my php handler from SuPhp to DSO and now everything is working fine and smooth..

    So Now Please Tell me will it be good to use DSO PHP handler ? I am not a host or anything.. I use my server for my private use only.. What are the disadvantages of DSO and is it good to use ?

    Also does it uses a domain's seperate php.ini file or uses the main file which is located in /etc/xxx something like here.

    Thank you
     
  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
    DSO runs processes as the user nobody and requires higher level permissions to run, which can be a security risk. suPHP only allows 644 file permissions and 755 folder permissions as the highest level and runs processes as the user of the account. As such, if you want to switch back to suPHP, you would likely simply need to fix the file permissions on your files and folders.

    There's a discussion about switching to suPHP from DSO at the following location:

    http://forums.cpanel.net/f5/switching-suphp-160421.html#post672630
     
  5. Torro99

    Torro99 Registered

    Joined:
    Oct 28, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    These errors can be caused by something on the server, or an supply on the user’s position. Here ‘s what you should do if you see errors:

    Verify the logs
    You can cypher most problems quick righteous by perception at the logs:

    /usr/local/apache/logs/error_log

    /usr/local/apache/logs/suphp.log

    Here are some common errors:

    SoftException in Application.cpp:357: UID of script “/home/exuser/public_html/test.php” is smaller than min_uid
    SoftException in Application.cpp:422: Mismatch between target UID (511) and UID (5Ǫ) of file “/home/exuser/public_html/test.php”
    SoftException in Application.cpp:Ꮘ: File “/home/exuser/public_html/test.php” is writeable by others

    These are all permission/ownership issues, indicating that the core of the PHP enter being called in erroneous, or the permissions are higher than what is allowed in suphp.conf.

    Wound directions in .htaccess

    If you’re working PHP in CGI or suPHP style, you can’t use php_flag or php_value directives in .htaccess – you either condition to use htscanner to figure Athabascan to parse those commands, or pass php-related changes in php.ini within the user’s informing. You can checkout the Athabascan nonachievement log in /usr/local/apache/logs/error_log to see if you get something like this:

    /home/exuser/public_html/.htaccess: Invalid command 'php_flag', perhaps misspelled or defined by a module not included in the server configuration

    If the failure log indicates a difficulty with .htaccess, you poverty to vanish the directives indicated and play reliable your ssyntax is rectify, and that they are in the correct places.

    Last resort

    If all else fails, you could be running a bum Apache build. Try running EasyApache to reinstall to see if that fixes the problem.


    these tips I get from /http://www.boxtutorials.com/how-to-fix-php-500-internal-server-errors-on-cpanel-server.html , and this I consider more help me!

    may be useful :)
     
  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 thread I linked to previously had these instructions and more in identifying the cause and didn't link to another site.
     
  7. MarkDClarke

    MarkDClarke Registered

    Joined:
    Mar 3, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi all

    I'm very new to WHM and am currently setting up a VPS for my company

    I was also getting error 500's when attempting to load PHP files

    in Configure PHP and suEXEC,I switched from suPHP to DSO and they now load correctly

    As I don't really know the difference between the 2, am I asking for trouble down the line?

    Thanks
     
  8. cPanelJamyn

    cPanelJamyn Social Engineer
    Staff Member

    Joined:
    Jan 29, 2009
    Messages:
    105
    Likes Received:
    2
    Trophy Points:
    0
    Hi,

    I would recommend using SuPHP (or mod_ruid2) instead of DSO, unless you absolutely must stick with DSO. Granted, DSO mode is faster, but it is a less secure option. There is a pretty good writeup explaining the difference between DSO and SuPHP here. To summarize:

    - DSO is faster. The downside is that scripts run as the "nobody" user, which makes it much easier for one customer to read files/folders from another customer.

    - SuPHP is slower, but scripts are executed as the user. This makes it possible to restrict permissions on files, so that one user cannot read another user's sensitive configuration files.
     
Loading...

Share This Page