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.

Enable PHP Version Switching

Discussion in 'General Discussion' started by gwen_the_hen, Mar 17, 2017.

Tags:
  1. gwen_the_hen

    gwen_the_hen Member

    Joined:
    Sep 3, 2016
    Messages:
    17
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Worcester
    cPanel Access Level:
    Root Administrator
    Hello,

    Is there a simple method for allowing cPanel accounts to switch between various PHP versions? I'm sure in the past I have seen this when using cPanel as a client, but I can't seem to find any option for this aside from using CloudLinux (which I don't want to do currently).

    On a related note, would it be possible to install PHP7 as part of this switcher or as a standalone upgrade?
     
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    588
    Likes Received:
    88
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
  3. gwen_the_hen

    gwen_the_hen Member

    Joined:
    Sep 3, 2016
    Messages:
    17
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Worcester
    cPanel Access Level:
    Root Administrator
    Great! Thanks for such a swift reply. Do you recommend doing this in most cases? Are there any concerns about doing so?
     
  4. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    588
    Likes Received:
    88
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    It can cause issues yes, I'd recommend giving a maintenance period for your users, the web server usually goes down during the transition and depending on how slow/fast the server is the downtime can vary but usually 2~ minutes.

    I'd also recommend changing the default PHP limits as the default ones are pretty low like memory_limit and upload file size, example by default I usually do:

    Code:
    sed -i 's/allow_url_fopen = Off/allow_url_fopen = On/g' /opt/cpanel/ea-php*/root/etc/php.ini
    sed -i 's/max_execution_time = 30/max_execution_time = 120/g' /opt/cpanel/ea-php*/root/etc/php.ini
    sed -i 's/max_input_time = 60/max_input_time = -1/g' /opt/cpanel/ea-php*/root/etc/php.ini
    sed -i 's/memory_limit = 32M/memory_limit = 128M/g' /opt/cpanel/ea-php*/root/etc/php.ini
    sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 64M/g' /opt/cpanel/ea-php*/root/etc/php.ini
    
    /scripts/restartsrv_apache
    
    You can run that right in SSH, but change the actual options as you see fit.

    If all hell breaks loose, and you are not sure what the issue is, you can revert back to EA3 as well.
     
  5. gwen_the_hen

    gwen_the_hen Member

    Joined:
    Sep 3, 2016
    Messages:
    17
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Worcester
    cPanel Access Level:
    Root Administrator
  6. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    588
    Likes Received:
    88
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Yes just run that, you are most likely not running the latest version of cPanel then as it was recently implemented to do the migration within WHM instead of using SSH
     
  7. gwen_the_hen

    gwen_the_hen Member

    Joined:
    Sep 3, 2016
    Messages:
    17
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Worcester
    cPanel Access Level:
    Root Administrator
    OK great, I will give it a go - thanks!
     
  8. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    588
    Likes Received:
    88
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    No problem!
     
  9. germany

    germany Member

    Joined:
    Jul 15, 2016
    Messages:
    16
    Likes Received:
    3
    Trophy Points:
    3
    Location:
    Berlin, DE
    cPanel Access Level:
    Website Owner
    For this goal I use - MultiPHP Manager.
     
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page