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.

Running php 4.x.x and 5.x.x together - possible?

Discussion in 'General Discussion' started by the_bobara, Jan 2, 2005.

  1. the_bobara

    the_bobara Well-Known Member
    PartnerNOC

    Joined:
    Sep 23, 2004
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Bulgaria
    cPanel Access Level:
    Root Administrator
    Hello
    Did someone try to run php 4 and 5 together.
    Some servers are confgired with php 4 and 5.and when you want to use scripts coded in php 5 you have to name it *.php5...
    how to do this please help....



    cPanel box:
    WHM 9.9.9 cPanel 9.9.9-S15
    CentOS 3.3 i686 - WHM X v3.1.0

    excuse me for my English
     
  2. fusioncroc

    fusioncroc Well-Known Member

    Joined:
    Sep 28, 2004
    Messages:
    261
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    U.K.
    i got this working perfectly on my server add me on msn sales@fusioncroc.com
    and i'll give you the intructions to do it
     
  3. dezignguy

    dezignguy Well-Known Member

    Joined:
    Sep 26, 2004
    Messages:
    534
    Likes Received:
    0
    Trophy Points:
    16
    why not post the instructions here for others?

    I'm not planning to do it myself, but it would still be interesting to read.
     
  4. netlook

    netlook Well-Known Member
    PartnerNOC

    Joined:
    Mar 25, 2004
    Messages:
    335
    Likes Received:
    0
    Trophy Points:
    16
    If you can, post this instructions here, on the cPanel forum :)
     
  5. fusioncroc

    fusioncroc Well-Known Member

    Joined:
    Sep 28, 2004
    Messages:
    261
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    U.K.
    cd /usr/local
    wget http://uk2.php.net/get/php-5.0.3.tar.gz/from/www.php.net/mirror
    tar -xvzf php-5.0.3.tar.gz.1
    cd php-5.0.3
    ./configure' '--with-xml' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-magic-quotes' '--with-mysql' '--enable-discard-path' '--with-pear' '--enable-sockets' '--enable-track-vars' '--enable-versioning' '--with-zlib' '--disable-debug' '--prefix=/usr/local/php5' '--enanble-force-cgi-redirect' '--with-config-file=/usr/local/php5/lib/php.ini' '--with-config-file-path=/usr/local/php5/lib/
    make
    make install
    cd /usr/local/
    cp php-5.0.3/php.ini-dist php5/lib/php.ini
    rm -rf php-5.0.3.tar.gz.1

    ----------------------------------------------------------------------
    php5 should now be installed along php4 now do the following
    --------------------------------------------------------------------------
    cd /usr/local/apache/conf/
    pico httpd.conf
    ctr + w addtype
    ---------------------------------------------------------------------------
    add below the php4 add types
    -----------------------------------------------------------------------------
    AddType application/x-httpd-php5 .php5
    ScriptAlias /php/ "/usr/local/php5/bin/"
    Action application/x-httpd-php5 "/php/php"


    -------------------------------------------------------------------------------
    last thing
    ------------------------------------------------------------------------------
    service httpd restart

    then create a file called phpinfo.php5 and create phpinfo.php and put the following code in it
    ------------------------------------------------------------------------------------------------------
    <?php phpinfo('');
    ?>

    then test it out it should most of the time work
     
    #5 fusioncroc, Jan 4, 2005
    Last edited: Jan 4, 2005
  6. Earendil

    Earendil Well-Known Member

    Joined:
    Jun 10, 2004
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    16

    Doesn't work here; not only that, but after it's installed you suddenly get weird requests from all over the place!
     
  7. the_bobara

    the_bobara Well-Known Member
    PartnerNOC

    Joined:
    Sep 23, 2004
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Bulgaria
    cPanel Access Level:
    Root Administrator
    it doesn`t work

    root@teddy [/usr/local/php-5.0.3]# ./configure' '--with-xml' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-magic-quotes' '--with-mysql' '--enable-discard-path' '--with-pear' '--enable-sockets' '--enable-track-vars' '--enable-versioning' '--with-zlib' '--disable-debug' '--prefix=/usr/local/php5' '--enahble-force-cgi-redirect' '--with-config-file=/usr/local/php5/lib/php.ini' '--with-config-file-path=/usr/local/php5/lib/
    -bash: ./configure --with-xml --enable-bcmath --enable-calendar --enable-ftp --enable-magic-quotes --with-mysql --enable-discard-path --with-pear --enable-sockets --enable-track-vars --enable-versioning --with-zlib --disable-debug --prefix=/usr/local/php5 --enahble-force-cgi-redirect --with-config-file=/usr/local/php5/lib/php.ini --with-config-file-path=/usr/local/php5/lib/: No such file or directory
     
  8. jamesbond

    jamesbond Well-Known Member

    Joined:
    Oct 9, 2002
    Messages:
    738
    Likes Received:
    1
    Trophy Points:
    18
    Haven't tried it but I noticed a mistake in the config

    '--enahble-force-cgi-' should be be '--enable-force-cgi-'
     
  9. fusioncroc

    fusioncroc Well-Known Member

    Joined:
    Sep 28, 2004
    Messages:
    261
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    U.K.
    sorry i was typing it up quick i'll edit the post
    btw i dont think it works with php4 as cgi as well
     
  10. Earendil

    Earendil Well-Known Member

    Joined:
    Jun 10, 2004
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    16
    The configuring and all works, but I get a 500 error; premature end of headers.
     
  11. hekri

    hekri Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    149
    Likes Received:
    2
    Trophy Points:
    18
    someone do that ? does it works ok?
     
  12. fusioncroc

    fusioncroc Well-Known Member

    Joined:
    Sep 28, 2004
    Messages:
    261
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    U.K.
  13. Josh Powell

    Josh Powell Registered

    Joined:
    Feb 13, 2005
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Another typo, --enanble-force-cgi-redirect should be --enable-force-cgi-redirect


    Josh
     
  14. hekri

    hekri Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    149
    Likes Received:
    2
    Trophy Points:
    18
    working fine but if you have i httpd.conf User login Group login you must delete this or
    #User login
    #Group login
     
  15. emeric21

    emeric21 Well-Known Member

    Joined:
    Aug 5, 2002
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    i get this error:

    Someone can help?
     
  16. projectandrew

    projectandrew Well-Known Member

    Joined:
    Aug 27, 2003
    Messages:
    185
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    United Kingdom
    I've got this working, but I've found POST does not seem to work on PHP5 - the $_POST array is empty. Anyone have any suggestions?
     
  17. Mr.Alien

    Mr.Alien Registered

    Joined:
    Mar 1, 2005
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I'm running both php4 and php5 on my server. I've done this an onther way.
    I have 2 apaches running. One for php4 and one for php5. The one for php4 on port 80 and the other on 81. I also setup a reverse proxy between the 2 apaches. This way i forward all php5 request on the port80 to the other.

    I also writen a script to copy all virtual host tag in the from the one to the other config file. And run this every night.
     
  18. the_bobara

    the_bobara Well-Known Member
    PartnerNOC

    Joined:
    Sep 23, 2004
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Bulgaria
    cPanel Access Level:
    Root Administrator
    hey,
    did somebody successed to run php4 and php5 as CGI ?
    i got this error
    Code:
     ./configure' '--with-xml' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-magic-quotes' '--with-mysql' '--enable-discard-path' '--with-pear' '--enable-sockets' '--enable-track-vars' '--enable-versioning' '--with-zlib' '--disable-debug' '--prefix=/usr/local/php5' '--enable-force-cgi-redirect' '--with-config-file=/usr/local/php5/lib/php.ini' '--with-config-file-path=/usr/local/php5/lib/
    -bash: ./configure --with-xml --enable-bcmath --enable-calendar --enable-ftp --enable-magic-quotes --with-mysql --enable-discard-path --with-pear --enable-sockets --enable-track-vars --enable-versioning --with-zlib --disable-debug --prefix=/usr/local/php5 --enable-force-cgi-redirect --with-config-file=/usr/local/php5/lib/php.ini --with-config-file-path=/usr/local/php5/lib/: No such file or directory
    
     
  19. SEAL31

    SEAL31 Well-Known Member

    Joined:
    Dec 4, 2004
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    6
    If you are getting the error when you put in the code, rmeove the first ' after ./configure.

    It looks like:

    ./configure'

    But should be:

    ./configure
     
  20. wildbomb

    wildbomb Member

    Joined:
    Jun 24, 2003
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Has anyone an idea how to make this work without commenting out this lines on every VirtualHost that you want it to work?

    Has it something to do with PHPSuexec?
    Where can the permissions be set, for what are these Tags in the VirtualHost?

    Thanks
     
Loading...

Share This Page