Use the newest version your site runs correctly on. The question is how to find it.
Support, in brief
The PHP project supports each version for a limited time: active bug fixes first, then security fixes only, then nothing. PHP 7.4 and 8.0 no longer receive official security fixes; later 8.x versions are supported for longer. Check the official PHP “Supported Versions” page for current dates.
What commonly breaks moving from 7.4 to 8.x
| Change | Typical error |
|---|---|
| Stricter handling of wrong argument types | TypeError or ValueError |
| Removed deprecated functions | Call to undefined function |
| Warnings promoted to errors | Code that “worked” now stops |
| Accessing undefined array keys or properties | Warnings flood logs (usually harmless) |
| Dynamic properties deprecated (8.2) | Deprecation notices |
Choosing
- Check your application’s requirements page. WordPress core, current plugins and modern frameworks support recent 8.x versions.
- Update the application first.
- Switch on a staging copy, or during a quiet period with a backup. How to change the PHP version in DirectAdmin
- Read the error log for fatal errors after switching. Deprecation notices can wait; fatal errors can’t.
Custom or old code
Code written before 2019 often needs changes for PHP 8. The error log tells you exactly which line. If a site can’t be updated, it’s carrying security risk that grows every year.
Everything in this guide works on Traxio’s PHP hosting, which is free for 30 days and £0.99 a month after that.