Electric Embers: Handcrafted hosting, powering the fires of change

PHP Major Upgrade

Issue: Upgrade from PHP 7.4 to PHP 8.0
Affects: ALL Web hosting users
Date upgrade is available upon request: Now
Date of general system-wide upgrade: September 12, 2022
Final upgrade of all remaining accounts: October 31, 2022

Introduction

The PHP language that powers most EE-hosted web sites is due for another major upgrade, the first since 2018, with the current PHP 7.4 no longer supported at all past November 2022.

We are moving to PHP 8.0, which has been in production since November 2020 – long enough to give most software developers plenty of time to update their code. So, if you’ve been applying updates to your site software either automatically or manually – a critical responsibility for every site owner – then in many cases the site should do fine with this and future PHP upgrades.

However, some sites are running software (themes, plugins, custom code of various sorts) that is not maintained and has no recent updates available, and thus will still break under PHP 8. We hope this document will help you test for such issues and prepare for the PHP 8 upgrade.

1. Timing of PHP upgrade
Here are the three options for when your account will receive the PHP upgrade:

  • If you believe that your web site software is up-to-date and compatible with PHP 8, we can switch you over now to PHP 8 upon request. If it turns out your site is not fully compatible, we can just as easily switch it back to PHP 7.4.
  • If you do not request a PHP 8 upgrade by September 12, 2022, your account will be upgraded automatically along with the remainder of our users on that night.
  • If your site is known NOT to be compatible yet and you need more time, just let us know and we will hold it back from the bulk upgrade on September 12. All such accounts will then have until October 31, 2022, at which point they will be upgraded, with no further option to remain on PHP 7.4.
2. Checking your site for potential issues
There are two approaches to checking for lurking PHP 8 compatibility issues, depending on your technical skills and experience:

  • If you are comfortable with the technical side of things (using SSH/SFTP, editing text files under Unix, and examining log files), the best way to know if your current site software is compatible with PHP 8 is to look for warnings in your web site’s error logs, specifically: any code that is at risk of breaking after the upgrade will generate log lines beginning with the string “PHP Deprecated“. See the next section for details on how and where to find these warnings.
  • If you are not comfortable with these methods, the simplest and quickest way to check for issues is to simply have us flip the switch to PHP 8 and see if anything breaks. This would obviously not be ideal if the site does go down, but the test is very quick to do and doesn’t require diving into technical matters, and we will flip it back for you within a matter of minutes if there is an obvious large-scale site failure. Just send us a note and we’ll arrange a time.
3. Finding PHP warnings in the error log

To see these PHP warnings, connect to your account by SFTP or SSH. There are then two possibilities that we’re aware of for what to do and where to look, depending on whether your site is running WordPress or not:

  • WordPress: WordPress suppresses the standard PHP logging by default, until you activate its internal DEBUG mode – and then it sends the logging by default to its own local file: debug.log in the wp-content directory. To activate debug logging to that file, edit your site’s wp-config.php configuration file, and make sure it has these three lines (the first of which you will probably find in there already but set to “false”, and the other two you will have to add):
    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    define('WP_DEBUG_DISPLAY', false);

    (Summarized from: Debugging In WordPress)

  • Non-Wordpress: If not running WordPress, things are probably much easier here. You probably don’t need to change any settings anywhere, and you should find all PHP logging including these PHP Deprecated warnings in the file /weblogs/error/php.log. But if you’re running some other CMS (Drupal, Joomla, etc.), and you do not find any PHP warnings in this file, don’t assume everything’s okay! Check the technical documentation for your software to see if it also has a debug mode that needs activation in order to see PHP warnings, or if it’s redirecting them to a local file of its own.

If you connected via SSH, whether your filename is “debug.log” or “/weblogs/error/php.log”, you can then run a command like “grep Deprecated filename“, or you could watch the logging happen in real time with a command like “tail -f filename” while reloading the site in your Web browser. Or if you connected via SFTP, you can download the error log via SFTP and then view it on your own computer. The logged warnings will tell you exactly which PHP file triggered them (hence which software module, theme, or plugin), and exactly which deprecated feature of PHP was invoked.

4. Updating your site software

In many cases, if your site needs an update it will be as simple as logging in as an administrator and clicking okay on all available updates (core software, themes, plugins, etc), and it should just take a minute. But some packages (eg. possibly Drupal, and some major-version upgrades of other CMSes), will require a more manual process involving uploading and unpacking files using the Unix command line.

If you’ve already applied all available updates, but testing still yields deprecation warnings under PHP 7.4 or failures under PHP 8.0, then there must be at least one piece of software installed that will not be so easy. If it’s just too old and no longer maintained/updated, you will need to deactivate or remove it, either making do without whatever features it added or replacing it with some other similar but currently maintained module; you could also try to have a developer custom-code a bug fix for you. If the problematic module was originally custom-created for you by a developer in the past, then it will definitely need another round of developer attention.

5. Getting help

If you need help testing, updating, or fixing your site for PHP 8, Electric Embers does not have the capacity or even the skills to get involved at that level, but we always have a list of other providers we trust on our Referrals page. In addition, we have another developer in our network who has made himself available for help just with this particular upgrade, and we’ll be happy to provide his name and email address upon request.