Looking for updated information?
Visit the Hosting Handbook Server Environment page.
Some time ago, we commented on the compatibility of WordPress with PHP 8. Since the release of this version of PHP, and the major versions of WordPress that have appeared since then, have led to the creation of concepts unknown to the WordPress community, such as “beta compatible” or “compatible with exceptions”.
We’ve had WordPress 6.3 with us for a while now, and maybe it’s time to clarify a few things, which we’ll be keeping up with each major version of WordPress as it’s released.
WordPress’ server requirements
Even if there are more stable software versions, that doesn’t mean they are the ones WordPress recommends.
Note that WordPress 6.3 brings an important update: Dropping support for PHP 5.
This makes WordPress 6.3 requirements:
- PHP: 7.0+
- MySQL: 5.0.15+
- MariaDB: 5.5+
You can read more at Server requirements.
WordPress’ compatibility “at the time”
WordPress 6.3 was released on August 8, 2023, and at that time we had the following components available (stable or security-maintained versions only).
- PHP: 8.0–8.2
- MySQL: 5.7–8.1
- MariaDB: 10.4–10.6 and 10.9–11.0
You can read more at WordPress Compatibility.
WordPress and PHP
PHP is a programming language on which WordPress code is based. This language runs on the server, and it is critical to keep it up to date, both for security and functionality.
WordPress supports many versions of PHP, some even obsolete (PHP Compatibility and WordPress Versions).
WordPress 6.3 (core) is:
- fully compatible with PHP 7.01, 7.11, 7.21, 7.31, and 7.41.
- compatible with exceptions with PHP 8.0, and 8.1
- beta compatible with PHP 8.2.
1 SECURITY ALERT: These versions are not officially maintained by PHP, so they are considered insecure and obsolete versions and should not be used in production. Check with your hosting provider about the security maintenance they can do.
What “compatible with exceptions” mean?
PHP 8.0
- Named parameters. WordPress does not support named parameters.
PHP 8.0 supports optionally calling functions and class methods by specifying the parameter name, instead of calling them on the order of parameters that they are declared.
PHP, and many other programming languages, support positional parameters: The caller passes the parameters in the same order the function/method declares its parameters. - Filesystem WP_Filesystem_FTPext and WP_Filesystem_SSH2 when connect fails.
An investigation is underway as to why on some occasions the access to the files returns some type of error.
PHP 8.1
- htmlentities() et al needs the default value of the flags parameter explicitly set.
According to htmlentities(), the default for flags for PHP 8.1 was “changed fromENT_COMPATtoENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401”. All use cases for this functionality in WordPress Core are being investigated. - Replace most strip_tags() with wp_strip_tags().
There are rare occasions when the strip_tags() function is passed a null value, which generates a warning that the string is deprecated. - unregister_setting() for unknown setting.
As of PHP 8, attempting to unregister an undefined configuration results in PHP warnings: Warning: Trying to access array offset on value of type null.
What “beta” mean?
PHP 8.2
- Deprecation notices
A deprecation notice is not an error, but rather an indicator of where additional work is needed for compatibility before PHP 9.0. With a deprecation notice, the PHP code will continue to work and nothing is broken.
Hosting Team Recommendation
Taking all this into account, the Hosting Team’s recommendations for WordPress 6.3 are as follows (which may differ from the global ones).
- PHP: 8.1.x
- MySQL: 8.0.x
- MariaDB: 10.11.x
IMPORTANT: These recommendations are intended, primarily, for new installations by hosting providers.