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.

PHP 5.2.3 and PHPsuexec

Discussion in 'General Discussion' started by Mysteerie, Jul 4, 2007.

  1. Mysteerie

    Mysteerie Well-Known Member

    Joined:
    Dec 29, 2003
    Messages:
    129
    Likes Received:
    0
    Trophy Points:
    16
    Anyone successfully running these two yet? If so, how did you update since I am still running into malformed headers and 500 errors when upgrading to that version.
     
  2. nat

    nat Well-Known Member

    Joined:
    Jan 16, 2003
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Try this after building...

    mv /usr/bin/php /usr/bin/php.old

    ln -s /usr/bin/php-cgi /usr/bin/php
     
  3. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    PHP v5.2.3 changed the CGI binary name from 'php' to 'php-cgi' ....

    For phpSuExec, you need to change the handler name from "php" to "php-cgi" in the httpd.conf

    For SuPHP, you need to update the PHP binary name called from the suphp.conf file.
     
  4. nat

    nat Well-Known Member

    Joined:
    Jan 16, 2003
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    I have phpsuexec.

    The only php stuff in httpd.conf that isn't comment out...

    AddHandler application/x-httpd-php .php .php4 .php3
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .phtml

    I changed the AddHandler from x-httpd-php to x-httpd-php-cgi and that just resulted in the php scripts being downloaded instead of ran.
     
  5. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Don't change the MIME format! You are updating the binary filename that is being called!
     
  6. nat

    nat Well-Known Member

    Joined:
    Jan 16, 2003
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    What do you change in httpd.conf to update the binary filename that is being called

    root@box [/etc/httpd/conf]# grep php httpd.conf

    #LoadModule php4_module libexec/libphp4.so
    #LoadModule php5_module libexec/libphp5.so
    #AddModule mod_php4.c
    #AddModule mod_php5.c
    DirectoryIndex index.html index.wml index.cgi index.shtml index.jsp index.js index.jp index.php4 index.php3 index.php index.phtml index.htm default.htm default.html home.htm
    AddHandler application/x-httpd-php .php .php4 .php3
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php .phtml
     
  7. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    I think there is some confusion over what Spiral had stated.

    Basically if you just do:

    mv /usr/bin/php /usr/bin/php.old
    ln -s /usr/bin/php-cgi /usr/bin/php


    This should resolve the issues. No changes to httpd.conf file. No changes to suphp.conf (if you are using suPHP).

    If you are using suPHP (which I don't think a lot of people are). A cleaner solution would be to edit the suphp.conf file and change:

    /usr/bin/php

    to

    /usr/bin/php-cgi

    If you are using phpsuexec, you will have to wait for cPanel to resolve this. phpsuexec depends on an Apache patch in order to work, and that patch has to be updated to reflect the php-cgi binary name instead of just php.

    But again:

    mv /usr/bin/php /usr/bin/php.old
    ln -s /usr/bin/php-cgi /usr/bin/php


    Should resolve this issue no matter what rendition of php as cgi you are using.

    It should also be worth mentioning that I'm not running PHP 5.2.3 with phpsuexec on any servers, so I can't verify if these steps are completely accurate.
     
Loading...

Share This Page