Results 1 to 12 of 12
  1. #1
    Join Date
    Aug 2006
    Posts
    67

    CPanel/WHM with PHP4 AND PHP5?

    Hello,

    I have a managed dedicated server with CPanel and WHM that is currently running PHP4.

    I need to keep PHP4 since some of the scripts I have installed will not run with PHP5. At the same time I want to develop new scripts on PHP5.

    Is it possible to have both without any complications under Cpanel/WHM?

    if yes, are there more than one ways to do it?

    Thanks

  2. #2
    Join Date
    Apr 2001
    Location
    Paradise
    Posts
    12,052
    Yes, you can, take a look to the Cpanel forums, you'll find a thread about how to set it.
    Shared Web Hosting - Reseller Hosting - Semi-Dedicated Servers - SolusVM/XEN VPS
    LiteSpeed Powered - R1Soft Continuous Data Protection - 24/7 Chat/Email/Helpdesk Support
    Cpanel/WHM - Softaculous - R1soft Backup - Litespeed - Cloudlinux -Site Builder- SSH support - Account Migration
    DowntownHost LLC - In Business since 2001- West/Center/East USA - Netherlands - Singapore

  3. #3
    Join Date
    Sep 2005
    Posts
    551
    I found this searching google: http://forums.powervps.com/showthread.php?p=14032

  4. #4
    Join Date
    Apr 2006
    Posts
    569
    I heard you can have both.

  5. #5
    Join Date
    Aug 2006
    Posts
    67
    Thanks.

    I will not do it myself since I am an a managed server and I hope my host will do this for me.

    Is this something usual with Cpanel or it is more of a hack?

  6. #6
    Join Date
    Oct 2003
    Posts
    9,264
    zoom123,

    Just a note that as php6 was just released you should just convince them to upgrade. Sticking around any longer on the php4 version is a waste of their time.

  7. #7
    Join Date
    Dec 2001
    Location
    127.0.0.1
    Posts
    3,642
    Quote Originally Posted by David
    zoom123,

    Just a note that as php6 was just released you should just convince them to upgrade. Sticking around any longer on the php4 version is a waste of their time.
    I disagree - some apps *still* have issues with a PHP5 setup, which requires staying on 4.x for awhile longer until the developer upgrades their code to be compliant. Not to mention, the PHP developers are still actively developing PHP4 and 5 in tandem.
    Simpli Networks, LLC :: http://www.simplinetworks.com :: Proudly 100% Owned.
    Providing Affordable Managed Cloud/VPS Servers & Server Management Solutions.
    We offer REAL 24x7x365 in-house support - proudly serving our customers since 2005!
    Want to learn more? Give us a call - +1 (844) 4SIMPLI or email sales[@]simplinetworks.com today!

  8. #8
    Join Date
    Aug 2004
    Location
    Earth
    Posts
    8,154
    Is this something usual with Cpanel or it is more of a hack?
    You have to do it manually, so it's more of a hack.

    Run this script from > http://forums.cpanel.net/showthread....ight=php5+php4

    Code:
    #!/bin/sh
    #
    # Copyright (C) 2005 Richard Gannon.  All rights reserved.
    #
    # Author: Richard Gannon
    #
    # This script will install PHP5 as a CGI on a cPanel server using the same configure
    # selections as the already built PHP4.  You can have PHP scripts utilize the PHP5
    # engine by using the .php5 extension.
    #
    # Version 1.1
    #
    ##
    
    PHP_VERSION=5.1.6
    
    WGET=/usr/bin/wget
    GREP=/bin/grep
    TAR=/bin/tar
    AWK=/bin/awk
    
    cd /usr/src
    $WGET -O php.tbz2 http://php.net/get/php-${PHP_VERSION}.tar.bz2/from/this/mirror
    $TAR -xjvf php.tbz2
    rm -f php.tbz2
    $WGET http://choon.net/opensource/php/php-${PHP_VERSION}-mail-header.patch
    cd php-${PHP_VERSION}
    patch -p1 < /usr/src/php-${PHP_VERSION}-mail-header.patch
    rm -f /usr/src/php-${PHP_VERSION}-mail-header.patch
    
    if [ -e /usr/local/bin/php ]; then
    	PHP=/usr/local/bin/php
    else
    	PHP=/usr/bin/php
    fi
    CFG=`$PHP -i | $GREP configure | sed "s/'//g" | sed "s/\.\/configure \(.*\)--with-apxs.*apxs \(.*\)/\1 \2/"`
    CFGLINE="${CFG##* => } --prefix=/usr/local/php5 --exec-prefix=/usr/local/php5 --program-suffix=5 --enable-force-cgi-redirect --enable-discard-path"
    
    ./configure $CFGLINE
    make
    make install
    
    cp -f php.ini-recommended /usr/local/php5/lib/php.ini
    
    cp /usr/local/php5/bin/php5 /usr/local/cpanel/cgi-sys/php5
    chown root:wheel /usr/local/cpanel/cgi-sys/php5
    
    PHP5CONF=`$GREP php5.conf /usr/local/apache/conf/httpd.conf`
    if [ "$PHP5CONF" = "" ]; then
    	echo "Action application/x-httpd-php5 \"/cgi-sys/php5\"" > /usr/local/apache/conf/php5.conf
    	echo "AddType application/x-httpd-php5 .php5" >> /usr/local/apache/conf/php5.conf
    	echo "Include /usr/local/apache/conf/php5.conf" >> /usr/local/apache/conf/httpd.conf
    fi
    
    CONFIGTEST=`/etc/init.d/httpd configtest | $GREP -m1 Syntax | $AWK '{print $2 }'`
    if [ "$CONFIGTEST" = "OK" ]; then
    	echo "Restarting Apache now..."
    	/etc/init.d/httpd restart
    	echo "Done.  Enjoy PHP5!"
    else
    	echo "There may have been a problem with this installation."
    	echo "Please check the httpd.conf for syntax with '/etc/init.d/httpd configtest'"
    fi
    
    exit 0
    Another help topic is at
    http://forums.cpanel.net/showthread....ight=php5+php4

    Since your server is managed, your system administrator should be able to do it without any problems

  9. #9
    If you play around with .htaccess or the httpd.conf file, you can also make it so that those intending to solely run php5 do not have to rename every php5 script to a .php5 extension (only works if said account plans to just use php5 scripts). I'll have to copy and paste the hack later.

  10. #10
    I can do this in DA?

    Meni.

  11. #11
    Join Date
    Jun 2003
    Location
    UK
    Posts
    6,616
    Its possible on DA but you can't run Zend if you do it
    Russ Foster - Industry Curmudgeon
    Freelance Sysadmin for Hire - email vaserv@gmail.com

  12. #12
    Join Date
    May 2001
    Location
    HK
    Posts
    3,082

    Smile

    You sure?
    I have PHP4 & PHP5 + Zend + eAccelerator running on a DA box with no problem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •