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 Upgrade

Discussion in 'General Discussion' started by Amit Deshmukh, Nov 12, 2007.

  1. Amit Deshmukh

    Amit Deshmukh Well-Known Member

    Joined:
    Jul 1, 2007
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    How do I upgrade from PHP 4 to PHP 5 and what are the changes to be made on the server to avoid any issue ?

    Regards,
    Sam ;)
     
  2. 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
    To upgrade PHP, go to WHM -> Software -> Apache Update and follow the on-screen instructions. When prompted for which version of PHP to use, select PHP 5.

    Note, if you are on STABLE, you will still be on EasyApache 1 at this time instead of the newer and more user-friendly EasyApache 3.

    Documentation for EasyApache 3 can be found at:

    http://www.cpanel.net/support/docs/ea/ea3/
     
  3. tangowebs

    tangowebs Well-Known Member

    Joined:
    Oct 12, 2004
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    0
    And what do I have to do if I want both php4 and 5 installed on my server?
    Any tutorial about that?
     
  4. shahbazaslam

    shahbazaslam Member

    Joined:
    May 29, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Please make is sure that you install php 5 with previous loaded modules.
    For this you will have to make a phpinfo page and save it at your htdocs directory. Then load that page : http://your ip/phpinfo.php . at here you will see all the modules.
    for both you will have to chroot +i php5 on a particular domain directory or files.
     
  5. 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
    It's not that hard, if you are running EDGE, CURRENT or RELEASE simply go to WHM -> Software -> Apache Update and proceed to customize. When prompted for which PHP versions you wish to run, select both PHP 4 and PHP 5.
     
  6. tangowebs

    tangowebs Well-Known Member

    Joined:
    Oct 12, 2004
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    0
    I saw that information on other forum, but my WHM doesnt allow me to select boths php4 and php5. Is not a tick box, is a radio button to select between all php versions...
    Is there anyway I can pass to another cpanel version? or install what u are telling me? My cpanel information is:

    WHM 11.2.0 cPanel 11.11.0-S18033
    REDHAT Enterprise 4 x86_64 on standard - WHM X v3.1.0
     
    #6 tangowebs, Nov 23, 2007
    Last edited: Nov 23, 2007
  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
    If you are on STABLE, you can move to RELEASE by going to WHM -> Server Configuration -> Update Config. Set your upgrade setting there either to Automatic (RELEASE tree) or Manual Updates Only (RELEASE tree). To actually move to RELEASE, go to WHM -> cPanel -> Upgrade to Latest Version and click the button labeled Click to Upgrade. This can take quite a few minutes and cpsrvd will restart at the conclusion of the upgrade.
     
  8. tangowebs

    tangowebs Well-Known Member

    Joined:
    Oct 12, 2004
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    0
    I run the wizard on WHM... do I have to configure anything else to make php4 predefined and php5 to run as cgi?

    How do I test if all modules are installed and all is working fine?

    Thanks for the support, your help solved 99% of my actual problems :)
     
  9. 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
    Wwith the latest builds of EA3, I believe it asks you how you want PHP 4 and 5 to run at the conclusion of the compile process (which I admit, can seem like forever sometimes). You can change these settings at a later time by going to WHM -> Service Configuration -> Configure PHP and SuExec.
     
    #9 cPanelDavidG, Nov 23, 2007
    Last edited: Nov 23, 2007
  10. tangowebs

    tangowebs Well-Known Member

    Joined:
    Oct 12, 2004
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    0
    After easyapache3

    php.conf updated to:

    # This file was automatically generated by the Cpanel PHP Configuration system
    # If you wish to change the way PHP is being handled by Apache on your system,
    # use the /usr/local/cpanel/bin/rebuild_phpconf script or the WHM interface.
    #
    # Manual edits of this file will be lost when Apache is updated.


    # SuPHP configuration for PHP5
    LoadModule suphp_module modules/mod_suphp.so
    suPHP_Engine on
    AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
    <Directory />
    suPHP_AddHandler application/x-httpd-php5
    </Directory>
    <Files *.php5>
    suPHP_AddHandler application/x-httpd-php5
    </Files>
    <Files *.php4>
    suPHP_AddHandler application/x-httpd-php5
    </Files>
    <Files *.php>
    suPHP_AddHandler application/x-httpd-php5
    </Files>
    <Files *.php3>
    suPHP_AddHandler application/x-httpd-php5
    </Files>
    <Files *.php2>
    suPHP_AddHandler application/x-httpd-php5
    </Files>
    <Files *.phtml>
    suPHP_AddHandler application/x-httpd-php5
    </Files>

    # End of autogenerated PHP configuration.


    Updating user configurable PHP settings.
    Restarting Apache


    Is it ok? I want php4 as default and php5 optional.
     
  11. 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
    Go to WHM -> Service Configuration -> Configure PHP and SuExec and simply select 4 for Default PHP Version (.php files)

    Note that PHP 4 reaches EOL on 8/8/08.
     
  12. tangowebs

    tangowebs Well-Known Member

    Joined:
    Oct 12, 2004
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    0
    I did that... what handles should I use for each one?

    Note that PHP 4 reaches EOL on 8/8/08. <--- whats that?
     
  13. 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 documentation referenced on that page has some good information you can use to make an informed decision:

    http://www.cpanel.net/support/docs/ea/ea3/ea3php_php_requests.html

    EOL means End of Life. This is essentially when a product is considered dead by its manufacturer due to old age/antiquity. No further bug fixes, security updates etc. will be made for PHP 4 after that time. All users should be migrated to PHP 5 before 8/8/08.
     
  14. tangowebs

    tangowebs Well-Known Member

    Joined:
    Oct 12, 2004
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    0
    Oh David thanks x 100000! I know that but almost all client I have are working on php4... still.. so if I modify that, all pages will crash
    Thanks for the info!
     
  15. 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
    Most PHP 4 code will work in PHP 5. PHP 4 code not working in PHP 5 is more the exception than the norm. Hence, many providers initially set up a concurrent PHP system and set the default to PHP 5, so the few PHP 4 scripts that break can be renamed to have a .php4 extension instead of .php so they can continue functioning.

    Most of the scripts to break are likely to be custom scripts or PHP Apps that haven't been updated in the past 2 years. Most downloadable PHP apps are now compatible to PHP 5. In recent weeks, I've even noticed various open source PHP projects dropping PHP 4 support like a hot potato.
     
  16. tangowebs

    tangowebs Well-Known Member

    Joined:
    Oct 12, 2004
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    0
  17. 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
    Is the server running PHP 4 or PHP 5? I ask since simplexml_load_file() is a PHP 5 function.
     
  18. tangowebs

    tangowebs Well-Known Member

    Joined:
    Oct 12, 2004
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    0
    php4... but when it was php5 it failed too :(
     
  19. 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 fact that function doesn't exist in PHP 4 may explain why it is not working at the moment.

    As for it failing while running PHP 5, I'd have to see the error message generated while it was running PHP 5.
     
  20. tangowebs

    tangowebs Well-Known Member

    Joined:
    Oct 12, 2004
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    0
    Thanks for the sugestion...we are upgrading to php5 now...
     
Loading...

Share This Page