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 version selection per account?

Discussion in 'General Discussion' started by Andrew Duck, Oct 5, 2007.

  1. Andrew Duck

    Andrew Duck Member

    Joined:
    Aug 17, 2003
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Is it currently possible to select either PHP 4 or 5 per account or per directory? Rather than the standard .php .php4/5 file naming that is available? It would be nice to have clients be able to choose which version they want available in a specific dir or for their account.

    Renaming 1300 files to .php5 and fixing all the broken includes is a pain in the...
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    #2 cPanelKenneth, Oct 5, 2007
    Last edited: Oct 5, 2007
  3. ramprage

    ramprage Well-Known Member

    Joined:
    Jul 21, 2002
    Messages:
    667
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    You can also setup a custom version of PHP 5 and just have those who want to use PHP 5 add a line to their .htaccess file to make everything process under PHP5. If they don't have anything in .htaccess is will use PHP4 by default.
     
  4. jrehmer

    jrehmer Well-Known Member

    Joined:
    Apr 10, 2003
    Messages:
    287
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Denver, CO

    Can you elaborate more on how to do this? I read the documentation but there's nothing specific about setting the PHP version, and AFAIK there are many ways to accomplish this... What would be the preferred method?
     
  5. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    There is no preferred method.

    Usually the easiest is to specify it in a .htaccess file.

    If you want it for all domains owned by an account, then you stipulate it in an include file"

    /usr/local/apache/conf/userdate/2/std/account/custom.conf (as an example).

    Look at the definitions in /usr/local/apache/conf/php.conf to see how to stipulate the default PHP version, then add a modified form to either a .htaccess file or the include file.

    Once an include file is made, run /scripts/ensure_vhost_includes
     
  6. Westone Hosting

    Joined:
    Dec 9, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hi

    is it poss to do this the other way round so php5 is the default as (php4 support by php)is poss to end by the end of this year?

    Westone Hosting
     
  7. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
  8. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Try in WHM using the Configure PHP and Suexec function
     
Loading...

Share This Page