Kinsta is phasing out HHVM as of August 20th, 2018 due to the fact that it’s no longer a stable or supported solution for WordPress or PHP. Because of this, we are requiring that all clients using HHVM switch their sites to PHP. Today we’ll walk you through the steps on how to best test your WordPress site for compatibility before flipping the switch.
Many of you shouldn’t experience any downtime and there will be little work required. For others, additional testing, troubleshooting, and even hiring a WordPress developer to make things compatible might be required.
Step 1 – Create a Staging Site
The very first thing you should do is create a staging site.
In the MyKinsta dashboard, click on “Sites” in the left navigation. You will see a list of your sites. Click on the one you’d like to add a staging area to (the site you’re switching from HHVM to PHP). Click on “Staging” from the drop-down menu at the top right, then click on the “Create a Staging Environment” button.
Make sure to also check out the important notes regarding staging environments. For example, if you’re using a third-party CDN, you might need to disable it for your site to render correctly. This is because your staging site uses a different URL. Caching is also disabled on staging, so please keep this in mind if you are trying to test performance.
Step 2 – Change PHP Engine
The next step is to change your PHP engine. We offer PHP 5.6, 7.0, 7.1, 7.2, and 7.3. Each major release of PHP is typically fully supported for two years. During that time, bugs and security issues are fixed and patched on a regular basis. PHP 5.6 and 7.0 will be phased out toward the end of the year.
That is why we highly recommend moving to a higher version of PHP, preferably PHP 7.2 or 7.3. PHP 7.3 now dominates in terms of performance.
To change the PHP engine, first, confirm you have your staging site selected from the drop-down menu. Then click on the “Tools” tab. Under “PHP Engine” click on the drop-down and select your preferred PHP version. Again, we recommend first testing your site with PHP 7.3. If you it has problems, you can always come back and change to a lower version.
Step 3 – Test Your Site, Plugins, Theme
You should now have a staging site up and running on the latest version of PHP (or the version you are wanting to switch to). The first thing you should do is simply browse and click around on your WordPress site to see if you notice anything broken.
If something is incompatible, such as a plugin or your theme, you might see a 500 error or white screen of death on the front-end of your site. In this case, the easiest and quickest way to determine what might be causing it is to disable all of your third-party plugins and re-enable them one by one. Remember, you’re on a staging site. So you don’t have to worry about breaking anything.
In your WordPress dashboard under the “Plugins” screen, select all of your plugins. Then select “Deactivate” from the drop-down and click “Apply.”
You can then re-enable them one by one, visiting your WordPress site each time. This will help narrow down what might be causing an issue. Don’t have access to your WordPress dashboard because of an error? No problem, check out how to disable plugins via FTP.
The exact same tests can be used with your WordPress theme. You can temporarily switch back to the default WordPress theme, such as Twenty Seventeen theme.
View Log Files in MyKinsta
Perhaps you have determined which plugin or theme is causing the issue but not sure why? This is where your WordPress error logs can come in handy. Simply click into one of your WordPress sites and on the right-hand side click on “Error Logs.” You can view your error.log, kinsta-cache-perf.log, and access.log files. By default, it will show the last 1,000 lines. You can drag the slider across to see the last 20,000 lines.
Important: The MyKinsta logs tool doesn’t show debug info. If you need to view debug information, you can enable
WP_DEBUG as we’ll show you below.
View Raw Log Files via SFTP
You can see the completely unmodified logs in
/logs/ via SFTP.
Tail Your Log Files via SSH
You can tail the logs while you experiment on your site using SSH. This basically means you can watch the log update live while testing. All Kinsta’s hosting plans include SSH access.
Show last 500 lines
tail -n 500 /www/sitename/logs/error.log
Watch the file live
Watch your error log file update on the fly.
tail -f /www/sitename/logs/error.log
For those of you with SSH access, WP-CLI can also be an invaluable tool.
Enable Debug Logging in WordPress
If you don’t have SSH access, you can always enable debug logging in WordPress. First, you will need to connect to your site via SFTP. Then download your
wp-config.php so you can edit it.
Find the line that says
/* That's all, stop editing! Happy blogging. */ and just before it, add the following (as seen below):
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false );
If the above code already exists in your
wp-config.php file but is set to “false,” simply change it to “true.” This will enable debug mode and show everything in your
/wp-content/debug.log file. You will also see warnings and errors in your WordPress admin if they exist.
Important: Don’t forget to turn it off when you’re done as these files can get pretty huge very quickly.
Confushed as to What to Look For?
There are thousands of plugins and themes out there, so, unfortunately, it’s impossible for us to list all the errors you might experience. Typically these occur due to code (functions, syntax, etc.) being incompatible with the version of PHP you’re using. However, here is an example of something you might see.
500: Fatal error: Uncaught Error: A semicolon (';') is expected here. in /www/sitename/public/wp-content/plugins/bbpress-shortcodes/bbpress-shortcodes.php:177
As you can see above, it’s pretty easy to quickly narrow down that it’s bbPress Shortcodes plugin causing a problem. In this specific instance, it was actually due to a bug with HHVM (#8194).
In worst case scenarios you might find that you have a compatibility issue with one or two plugins. If that is the case, here is what we advise:
- Update your plugins and themes to the latest version if you haven’t already.
- Reach out to the developer of the plugin or theme and ask them to add/fix support PHP 7.3 (or the current version you’re using). This is one reason we’re giving you a heads up before the phase-out dates!
- Find an alternative plugin that can deliver the same functionality and is compatible with the PHP version.
- Hire a WordPress developer to fix the issue.
- Change your PHP engine to a lower version and see if the plugin or theme then works. If it does, you could run on a lower version of PHP until the developer updates their code. We don’t recommend this as PHP 7.3 is faster and will remain supported for a longer period of time. But if there is something you absolutely need to run and it only works on PHP 5.6, then you might have to resort to this.
Step 4 – Push Staging to Live
Once you have finished testing your site with PHP, you can either push staging to live or make any necessary changes to the live site and then change the PHP version on your live site. Some of you may find that you have to make fairly exhaustive changes in staging to get the site running on a newer version of PHP. In that case, using the push to live feature will save you a lot of time.
To do this, make sure you have your staging environment selected. Then click the “Push Staging to Live” button.
Feel free to reach out to our support team 24×7 regarding concerns or issues with your switch from HHVM to PHP.