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 setup issue

Discussion in 'General Discussion' started by Legin76, Nov 18, 2010.

  1. Legin76

    Legin76 Well-Known Member

    Joined:
    Dec 11, 2007
    Messages:
    151
    Likes Received:
    1
    Trophy Points:
    18
    I'm not very experienced at server administration but seem be able to work my way though most things but I'm completely unable to get Suphp to work. I'm changing it from DSO.

    When I turn it on when going to any php address either shows the php code in the browser or tries to download it.

    On the sites I've been testing the permissions of the php files appear to be fine. It even does it with a phpinfo file.

    Nothing shows up in either the error log or suphp log other than info relating to common names not matching for ssl when it switches.

    I don't believe that anything in the .htaccess is causing any problems.

    Any help would be appreciated.

    The server is using WHM 11.28.39 on REDHAT Enterprise 5.5 i686 standard.
     
  2. tomdchi

    tomdchi Well-Known Member

    Joined:
    Feb 24, 2008
    Messages:
    116
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    cPanel Access Level:
    DataCenter Provider
    Things to try:
    Restart Apache - I think this needs to be done after changing handler.
    Recompile PHP and choose SuPHP after compile.
    I had some similar behavior a while back and to fix required PHP to be recompiled.
     
  3. Legin76

    Legin76 Well-Known Member

    Joined:
    Dec 11, 2007
    Messages:
    151
    Likes Received:
    1
    Trophy Points:
    18
    Thanks but no luck I'm affraid. :(
     
  4. Legin76

    Legin76 Well-Known Member

    Joined:
    Dec 11, 2007
    Messages:
    151
    Likes Received:
    1
    Trophy Points:
    18
    Can anyone else help with this?
     
  5. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    The issue of the browser being sent a PHP script to download is caused by a PHP handler not being defined for Apache. It should not be necessary to rebuild Apache and PHP, and Apache and PHP should not be recompiled until more troubleshooting is done.

    Make sure that httpd.conf has an include directive for php.conf. Missing this directive will cause no PHP handler to be defined. You should see this if you search for php.conf in httpd.conf:

    Code:
    # grep php.conf /usr/local/apache/conf/httpd.conf
    Include "/usr/local/apache/conf/php.conf"
    If there is no include line for php.conf in httpd.conf, add one, and then distill the configuration with the following command:

    Code:
    # /usr/local/cpanel/bin/apache_conf_distiller --update
    After verifying that there is an include directive, what is the output of the following commands?

    Code:
    # /usr/local/cpanel/bin/rebuild_phpconf --current
    # cat /usr/local/apache/conf/php.conf
     
  6. Legin76

    Legin76 Well-Known Member

    Joined:
    Dec 11, 2007
    Messages:
    151
    Likes Received:
    1
    Trophy Points:
    18
    There no problems using DSO and I have recompiled php a few times since this problem was discovered. It only occurs when using Suphp. The include line is in the http.conf.

    # /usr/local/cpanel/bin/rebuild_phpconf --current
    Available handlers: suphp dso fcgi cgi none
    DEFAULT PHP: 5
    PHP4 SAPI: none
    PHP5 SAPI: suphp
    SUEXEC: enabled

    # cat /usr/local/apache/conf/php.conf
    # This file was automatically generated by the Cpanel PHP Configuration system
    # If you wish to change the way PHP is being handled by Apache on your system,
    # use the /usr/local/cpanel/bin/rebuild_phpconf script or the WHM interface.
    #
    # Manual edits of this file will be lost when Apache is updated.


    # SuPHP configuration for PHP5
    LoadModule suphp_module modules/mod_suphp.so
    suPHP_Engine on
    AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
    <Directory />
    suPHP_AddHandler application/x-httpd-php5
    </Directory>

    # End of autogenerated PHP configuration.
     
  7. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Did you check to see if there is an include for php.conf in httpd.conf? I do not see the output of this command in your post:

    Code:
    # grep php.conf /usr/local/apache/conf/httpd.conf
    It should return this:

    Code:
    # grep php.conf /usr/local/apache/conf/httpd.conf
    Include "/usr/local/apache/conf/php.conf"
    If this line is present in httpd.conf, please submit a ticket so that we may work with you directly. Recompiling Apache and PHP should not normally be necessary to fix a handler issue, and this sounds like a problem of the PHP handler somehow not being defined correctly.
     
  8. Legin76

    Legin76 Well-Known Member

    Joined:
    Dec 11, 2007
    Messages:
    151
    Likes Received:
    1
    Trophy Points:
    18
    Yes the line is there.

    I'll open a ticket. Thanks.
     
Loading...

Share This Page