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.

Putting ONE client on PHP4, the rest on PHP5

Discussion in 'General Discussion' started by mpierre, Nov 25, 2007.

  1. mpierre

    mpierre Well-Known Member

    Joined:
    Jun 30, 2002
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    I compiled with Easyapache PHP4 and PHP5, and set the default to PHP5, with suphp on both PHP4 and 5 (I was using phpsuexec on PHP4).

    All of the accounts on that server worked with PHP5 with little modification, except ONE which uses an old obsolete CMS.

    It is composed of over 400 php files in over 20 directories, so I cannot rename them .php4

    I would like that WHOLE client to remain using PHP4, but I want to do it the proper way. httpd.conf can now be rebuilt on the fly during an upgrade of PHP, so I want to mark the client as using php4 permanently.

    Is there an easy way, like in .htaccess ? I read a few suggestions in various threads, but no one seems to have confirmed the proper syntax or that it worked.

    Wouldn't it be GREAT if in WHM and Cpanel there was a drop down to select which PHP version each domain would have ?

    Then again, if it's a .htaccess file, that would be really easy to do with or without a directive.

    Can someone confirm exactly how to :

    1 ) Force php4 on a client, regardless of the curent default
    2 ) Force php5 on a client, regardless of the curent default
     
  2. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
    Try adding the following line in public_html/.htaccess of that client:

     
  3. trhosting.net

    trhosting.net Well-Known Member

    Joined:
    Mar 7, 2006
    Messages:
    151
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Turkey
    If you look at the PHP Configuration page on this users cPanel account, you will see a PHP Version selection. You can simply set which version you want to use for this account.
     

    Attached Files:

    • ss.jpg
      ss.jpg
      File size:
      46.9 KB
      Views:
      182
  4. mpierre

    mpierre Well-Known Member

    Joined:
    Jun 30, 2002
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    It worked !

    Thanks a lot...

    Would it be hard to write a Cpanel plugin to let the client select which version to use ?
     
  5. mpierre

    mpierre Well-Known Member

    Joined:
    Jun 30, 2002
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Strike that, I just saw your attachment...
     
  6. peconi

    peconi Active Member

    Joined:
    Mar 27, 2005
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    I can't see the option in cPanel to change the default PHP version...

    How does one enable that in WHM??? Can't seem to find the setting anywhere.
     
  7. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    The option will only appear in cPanel if you are running both PHP 4 and PHP 5 on the server. You can set this up by checking the options for PHP 4 and PHP 5 in EasyApache when prompted for which version(s) of PHP you wish to use.
     
  8. peconi

    peconi Active Member

    Joined:
    Mar 27, 2005
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Yea, I have both PHP4 and PHP5 running, compiled 2 days ago via EA3.

    I don't see this option in my cPanel.

    I have PHP4 set to run via FCGI and PHP via DSO.

    cPanel running from Current branch - auto updated.
     

    Attached Files:

  9. mike1s

    mike1s Member

    Joined:
    Mar 15, 2008
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Riverview, Florida, United States
    Why aren't you forcing said client to upgrade his cms?? Why are you willing to allow such a security risk?
     
  10. peconi

    peconi Active Member

    Joined:
    Mar 27, 2005
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    I wish you answered my question instead.

    The guy who posted this thread did so in 2007, there's no point in telling him to upgrade now since he most likely did already ;)

    I on the other side cannot see the setting in cPanel :(

    All I see is: "These PHP configuration settings are customizable by the server administrator. They are listed for reference only."
     
Loading...

Share This Page