Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 13 of 13
  1. #1
    Member
    Join Date
    Mar 2006
    Posts
    74

    Default User choose php4 or php5

    We have installed easy apache 2.2 with php5 using dso and php4. Looking at the documentation, there is suppose to be an option in cPanel under software/services > php configuration.

    So when I go to that page in cPanel i get:

    These PHP configuration settings are customizable by the server administrator. They are listed for reference only.

    However in the documentation it says that a user will be given a selection:

    When PHP 4 and PHP5 are both enabled and served using the CGI, DSO, or SUPHP configurations, the Cpanel interface will contain a selector for setting the version of PHP that will act as the default for the account. The version of PHP selected will process .php files for all domains assigned to the account.

    The interface is available on the X3 theme under Software/Services -> PHP Configuration. Available settings are PHP4, PHP5, and System Default. The chosen value is reflected in the .htaccess file in the user's home directory. If the user requires that file extensions other than .php are processed by the selected version of PHP, add those file extensions after .php to the AddHandler line in the .htaccess file.


    Which in cPanel im not given any option, is there somewhere I need to enable this? I am running the latest stable build.

  2. #2
    Member darren.nolan's Avatar
    Join Date
    Oct 2007
    Posts
    259

    Default

    .htaccess file in the user's public_html is the easiest way to do this.

    Just add the following line to start using PHP5, if your default is PHP4 on the server;

    AddHandler application/x-httpd-php5 .php


    Strange that you wouldn't have it in cPanel - I have (you must be in the X3 theme, not x or x2) "PHP Configuration".

    You can pick system default, or change it to PHP4 or PHP5 from the drop down box. I've never even seen it there before. Always a .htaccess kind of guy.
    Last edited by darren.nolan; 12-17-2007 at 06:54 AM.

  3. #3
    Member
    Join Date
    Mar 2006
    Posts
    74

    Default

    I understand that, however I thought there was suppose to be a way that users could press one button to change this via cPanel, as thats what it says in the documentation.

    Also what would I use for php4 I have tried using
    AddHandler application/x-httpd-php4 .php

    However when loading a php file it asks me to download it
    Last edited by dan223; 12-17-2007 at 08:16 AM.

  4. #4
    Member
    Join Date
    Apr 2006
    Posts
    48

    Default

    Hi,

    Which version of Cpanel are you running? Also have you compiled both PHPs using easy apache?

  5. #5
    Member
    Join Date
    Mar 2006
    Posts
    74

    Default

    WHM 11.11.0 cPanel 11.16.0-S18450

    I have compiled both php 4 and php 5, php 5 is the default using dso. php 4 is none.

  6. #6
    Member darren.nolan's Avatar
    Join Date
    Oct 2007
    Posts
    259

    Default

    Strange - it's what I have.

    What version of WHM are you using? If it's asking you to download it, is it possible that apache doesn't have a handler for version 4? Or is version 4 your default?

    Edit: Nevermind, BlueZebra beat me to the question. Happens when you watch movies while trolling I guess

  7. #7
    Member
    Join Date
    Apr 2006
    Posts
    48

    Default

    I have never find it in users' cpanel. Rather it says in Cpanel >> Software/Services >>PHP Configuration that "These PHP configuration settings are customizable by the server administrator. They are listed for reference only."
    WHM >> PHP Configuration editor is the place to change it (server wide)

  8. #8
    Member darren.nolan's Avatar
    Join Date
    Oct 2007
    Posts
    259

    Default

    Quote Originally Posted by BlueZebra View Post
    I have never find it in users' cpanel. Rather it says in Cpanel >> Software/Services >>PHP Configuration that "These PHP configuration settings are customizable by the server administrator. They are listed for reference only."
    WHM >> PHP Configuration editor is the place to change it (server wide)
    In that area my users can change from PHP4 to PHP5 and vice versa.
    WHM 11.11.0 cPanel 11.15.0-E18347

  9. #9
    Member
    Join Date
    Jan 2005
    Posts
    47

    Default

    User can change their default php for each directory using .htaccess (both php is compiled as CGI)

  10. #10
    Member
    Join Date
    Mar 2006
    Posts
    74

    Default

    So could that be why? On the end of the build php5 said dso and the other said none, so i just accepted it. Should i put both a cgi?

  11. #11
    Member
    Join Date
    Jan 2005
    Posts
    47

    Default

    Its depend on your needs.. running PHP as CGI is consume more resources (as i know) but i have to do that because there is a several client still need PHP 4 and other want to use PHP 5.

    So i use custom php compilation for both of them and put two lines in each user .htaccess like :

    #unmark to set default PHP
    AddHandler application/x-httpd-php5 .php .php4 .php3 .phtml
    #AddHandler application/x-httpd-php4 .php .php4 .php3 .phtml


    regards

  12. #12
    cPanel Staff
    Join Date
    Mar 2007
    Posts
    113

    Default

    The text above indicates why it's not showing in the interface:

    "When PHP 4 and PHP5 are both enabled and served using the CGI, DSO, or SUPHP configurations..."

    Both versions of PHP have to be turned on in the WHM PHP & Suexec configuration tool and you can't be using mod_fcgid to handle either one.

  13. #13
    Member
    Join Date
    Mar 2006
    Posts
    74

    Default

    Quote Originally Posted by jdlightsey View Post
    The text above indicates why it's not showing in the interface:

    "When PHP 4 and PHP5 are both enabled and served using the CGI, DSO, or SUPHP configurations..."

    Both versions of PHP have to be turned on in the WHM PHP & Suexec configuration tool and you can't be using mod_fcgid to handle either one.
    Cheers, that was the problem!

Similar Threads & Tags
Similar threads

  1. list of user who are using php4 and php5
    By classical in forum New User Questions
    Replies: 2
    Last Post: 02-03-2011, 11:47 PM
  2. How to php4 and php5 (.php5) in same server?
    By strikinado in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-09-2007, 11:01 AM
  3. PHP4 or PHP5?
    By zigzam in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 05-09-2007, 08:37 AM
  4. Php4 + Php5
    By chris8lunch in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 10-31-2006, 07:08 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube