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.

Using PHP 4 & PHP5 on 1 server?

Discussion in 'General Discussion' started by approx, Mar 28, 2007.

  1. approx

    approx Well-Known Member

    Joined:
    Mar 6, 2007
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    Hi all,

    I'm the admin of webhosting company. Now I'm using PHP4. Is that posibble if I use PHP4 & PHP5? If it's posibble how to do it?

    Thank's for any kind of help :)
     
  2. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Yes, it's possible but why would you want to?

    PHP 5 is completely backwards compatible with PHP 4 ...

    There is only about 5 rarely used functions that are discontinued or changed
    enough that there might be an issue and in nearly 3 years using PHP 5,
    I've only found 2 applications where there were any actual compatibility issues.

    99.9% of the compatibility issues you hear from people actually have absolutely
    NOTHING to do with PHP 5 but rather the server owners mis-configuring their PHP
    or Apache installations.

    I have personally embarrassed more than a few programmers who publicly swore
    their programs wouldn't work with PHP 5 and it turns out their programs all
    work 100% perfectly with no problems whatsoever!

    You can run both PHP 4 and PHP 5 but I personally don't recommend it because
    of some internal conflict issues that it creates that most people don't realize
    (which ironically is the source of many compatibility reports out there)

    If you don't want to heed that advice, then the way you would do it is by installing
    one of the PHP versions as an Apache module and the other as a CGI and
    mapping the .PHP extension to the Apache module version and .PHP5 extension
    to the loadable CGI module.

    PS: Incidentally, we only run PHP 5 on all of our 76 hosting services
     
    #2 Spiral, Mar 28, 2007
    Last edited: Mar 28, 2007
  3. approx

    approx Well-Known Member

    Joined:
    Mar 6, 2007
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    Hi Spiral,

    Thank's for your reply. Actually I want to keep it with PHP4. But lot of new customer asking if we are using PHP5. That's why I intend to use PHP4 as CGI, and PHP5 as apache module. So it isn't posibble?
     
  4. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
  5. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    Does anyoene have a PHP5 + PHP4 HOWTO? Where PHP5 is the primary one, updated via /scripts/easyapache / WHM, and PHP4 the addon one?
     
  6. silversurfer

    silversurfer Well-Known Member

    Joined:
    Dec 29, 2002
    Messages:
    274
    Likes Received:
    0
    Trophy Points:
    18
    I have ran both php4 and php5 together but I don't see how the same concept cannot be applied in reverse to have php5 by default and php4 as an alternative. Just have php4 configure line reflect their own directories.
     
  7. elenlace

    elenlace Well-Known Member

    Joined:
    Sep 10, 2002
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    US
    Any pointers on how to run PHP4 for .php, .php4, .php3, .phtml files and PHP5 for .php5 files?
     
  8. nithintou

    nithintou Member

    Joined:
    Dec 22, 2006
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    we have this setup on our servers:
    AddHandler application/x-httpd-php5 .php5
     
  9. rsutc

    rsutc Well-Known Member

    Joined:
    Oct 8, 2002
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    6
    So I've been hesitating some over making the switch for reported compatibility reasons, now I hear you say there aren't any to speak of. Let's put it this way. If a server has CentOS, cPanel, Fantastico, RVSkin, and ConfigServer's security and mail setup, (IOW a fairly common arrangement) are there any known issues in ditching php 4.2 and going to 5.2? I ask because each upgrade I have done along the way has come with a few glitches. and I've had to retire one or more scripts. Are there any verifiable remaining claims of incompatibility out there for a setup like mine? Any additional things that have to be done in making the transition besides just letting EasyApache just go to it? I rather doubt there is any going back once the leap has been made.

    Rick
     
Loading...

Share This Page