Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

EA3 Migration to EA4 for PHP5.5 Versions

Discussion in 'EasyApache' started by JustAGuyUsingWHM, Mar 19, 2019.

  1. JustAGuyUsingWHM

    JustAGuyUsingWHM Member

    Joined:
    Sep 6, 2018
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    England
    cPanel Access Level:
    Root Administrator
    We're moving from Easy Apache 3 to 4 so we can migrate our web apps to PHP 7.2+ and upgrade to the latest version of cPanel (current version 76, latest version 78).

    One of our servers is configured to use PHP 5.5 to accommodate a Magento 1.7CE website. The other websites and apps are all capable of running PHP5.6.

    This blog post Removal of PHP 5.4 and PHP 5.5 in EasyApache Profiles | cPanel Blog seems to indicate EA4 no longer supports PHP 5.5 and will automatically re-provision the websites on the server to use PHP 5.6.

    Is that correct? Will the migration automatically upgrade the default version of PHP5.5 to PHP5.6? Or will it migrate across as PHP5.5 and only update if I re-provision using EA4?

    Thanks.
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    The EasyApache 4 conversion script should automatically set the default PHP version to 5.6 if it detects version 5.5 is utilized in your existing EasyApache 3 profile. You can browse to WHM >> MultiPHP Manager after the conversion completes to verify the PHP versions are correctly assigned to your domains.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. JustAGuyUsingWHM

    JustAGuyUsingWHM Member

    Joined:
    Sep 6, 2018
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    England
    cPanel Access Level:
    Root Administrator
    Some quick feedback on switching from EA3 to EA4 for those about to follow suit.

    - The EA3 to EA4 upgrade requires an Apache upgrade. In my case this was from 2.2 to 2.4.

    - The migration automatically switched websites on PHP5.5 to PHP5.6, but I was able to downgrade back to PHP 5.5 afterwards. I'm not sure what the expected behaviour here is, as Michael's comments seem to suggest PHP 5.6 should have been the minimum version, so I wouldn't rely on old versions of PHP being available without cPanel confirmation.

    - Websites running PHP with a CGI handler (running as nobody) were switched to the suPHP handler and scripts running under the cPanel account. This caused issues with file permissions where some files were not accessible by the cPanel user.

    - Suspect suExec was turned on following upgrade. This means if you run under CGI with suExex disabled and expect scripts to run as Nobody you may have some permission issues. The only way to turn off suExec in EA4 would appear to be to remove the Apache module.

    - PEAR modules were not migrated. Image Magic was lost and had to be reapplied.

    - .haccess php_values caused 500 errors. Frankly, I'm not sure why the .htaccess files ever worked (or at least failed to break) my old configuration of CGI no suExex enabled, but they did, and following the upgrade they didn't.

    I should say I didn't run the upgrade myself but had hosting support do it so they would be on hand to resolve any issues. It's possible they introduced some of the problems above but I don't think so.

    Should also say running PHP as a cPanel user with suExec or suPHP handler enabled is the way to go :)
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @JustAGuyUsingWHM,

    Thanks for sharing your EA4 migration feedback!

    PHP 5.5 is still available as RPM, but it's been removed from the profiles in WHM >> EasyApache 4 and we encourage anyone using it to migrate to a supported PHP version as soon as possible. Here's a blog post we created on this topic:

    Removal of PHP 5.4 and PHP 5.5 in EasyApache Profiles | cPanel Blog

    You can choose the PHP handler for each PHP version via WHM >> MultiPHP Manager in EA4. It's likely the use of suPHP as the default handler for PHP 5.6 (and the switch to PHP 5.6 for the accounts previously assigned PHP 5.5) lead to this issue because PHP 5.6 was not previously assigned it's own handler in EA3.

    The following document offers more information about each PHP handler and suexec in EA4 should you want to enable or disable it post-migration:

    PHP Handlers - EasyApache 4 - cPanel Documentation

    Were you able to determine the reason for the 500 error messages? If not, feel free to share the specific 500 error code message from the Apache error log and the contents of the .htaccess file and we can let you know the cause.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. JustAGuyUsingWHM

    JustAGuyUsingWHM Member

    Joined:
    Sep 6, 2018
    Messages:
    12
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    England
    cPanel Access Level:
    Root Administrator
    Thanks @cPanelMichael. Yes, read most of those docs before upgrading :)

    .htaccess

    The .htaccess issues were caused by things like: php_value upload_max_filesize 2M in the .htaccess file explained at PHP: How to change configuration settings - Manual.

    We were able to remove these and apply to them to the specific PHP version or place them in the php.ini file for a specific php version where necessary.

    My understanding is that these commands should only work with the Apache PHP Handler not CGI, FastCGI, suPHP etc. The commands weren't wrapped <IfModule mod_php5.c> syntax, as they should have been, so threw the error. As I said, not sure why they didn't throw the error with CGI no suExec handlers, I suspect because the module was loaded (but not used as the handler) they were being ignored.

    Cron and PHP

    The the other issue we've encountered is with Cron jobs running PHP scripts directly from the command line, where previously php <filenameandpath>.php worked but stopped following the upgrade because of the new MultiPHP implementation. This seems to provide the guidance need to work around that: EasyApache 4 and the ea-php-cli Package - EasyApache 4 - cPanel Documentation but I'd be interested to know if you have any other pointers.
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    1. The best approach to modifying PHP configuration values with EA4 is to use WHM >> MultiPHP INI Editor for global changes and cPanel >> MultiPHP INI Editor for account-level changes. These features are designed to automatically detect the PHP version and handler and make changes to the appropriate configuration files. Additionally, these features are designed to account for changes to the account's PHP handler or version in the futures so you don't have to make manual changes every time a version or handler changes. That said, there are some handler-specific notes to be aware of on the following documents:

    MultiPHP INI Editor for cPanel - Version 78 Documentation - cPanel Documentation
    MultiPHP INI Editor for WHM - Version 78 Documentation - cPanel Documentation

    If you'd like to make changes via the command line, I recommend using the following UAPI (for account level changes) and WHM API 1 (for global changes) commands:

    UAPI Modules - LangPHP - Developer Documentation - cPanel Documentation
    WHM API 1 Sections - PHP - Developer Documentation - cPanel Documentation

    2. For the cron jobs, here's a look at what's recommended for the PHP path (taken from the cPanel UI):

    Let me know if this helps.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice