As we explained in previous posts (WordPress 6.5, WordPress 6.4, WordPress 6.3), for each new version of WordPress, we aim to release an article explaining the compatibility of PHP with the WordPress versions and our team’s recommendation for that specific version.
On this occasion, once again, we will explain the details of compatibility, including “beta compatible” or “compatible with exceptions”.
So, here you have the compatibility information, this time, for WordPress 6.6.
Hosting Team Recommendation
The Hosting Team’s recommendations for WordPress 6.6 are as follows (which may differ from the global ones).
- PHP: 8.2.x
- MySQL: 8.0.x
- MariaDB: 10.11.x
IMPORTANT: These recommendations are intended, primarily, for new installations by hosting providers.
Where does that recommendation come from? We did review some configurations and options, we are going to explain.
WordPress’ server requirements
Even if there are more stable software versions, that doesn’t mean they are the ones WordPress recommends.
WordPress 6.6 requirements:
- PHP: 7.2.25+
- MySQL: 5.5.5+
- MariaDB: 5.5.5+
NOTE: Dropping support for PHP 7.0 and 7.1.
You can read more at Server requirements.
WordPress’ compatibility “at the time”
WordPress 6.6 (released on July 16, 2024) had the following components available (stable or security-maintained versions only, and RC only for informational purposes).
- PHP: 8.1 (Security Support), 8.2 (Active Support), and 8.3 (Active Support).
- MySQL: 8.0 (LTS), 8.2, 8.3, and 8.4 (LTS).
- MariaDB: 10.5 (LTS), 10.6 (LTS), 10.11 (LTS), 11.1, 11.2, and 11.4 (LTS).
- Apache HTTPD: 2.4.
- nginx: 1.26, and 1.27.
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.6 (core) is:
- fully compatible with 7.2 (1), 7.3 (1), and 7.4 (1).
- compatible with exceptions with PHP 8.0 (1), 8.1, and 8.2.
- beta compatible with 8.3.
(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. NOTE: Moved to WordPress 6.7.
- Filesystem
WP_Filesystem_FTPextandWP_Filesystem_SSH2when connect fails. An investigation is underway as to why on some occasions the access to the files returns some type of error. NOTE: Has a patch, but moved to WordPress 6.7. - Prepare for the internal functions throwing
TypeErrororValueErrorexceptions on unexpected types/values. Internal functions will throw an exception if the function call arguments are of a type that is not expected. NOTE: Has a patch, but moved to WordPress 6.7.
PHP 8.1
- Not all “passing null to non-nullable” issues have been found. In PHP, you can tell a function exactly what type of information it should accept. If you tell a function to expect a certain type of information, and you give it nothing at all (null is like saying “nothing”), then PHP gets confused and gives an error. This problem happens when someone accidentally gives a function “nothing” when the function wasn’t designed to handle “nothing”.
_htmlentities()needs the default value of the flags parameter explicitly set_. According to htmlentities(), the default for flags for PHP 8.1 was “changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401”. All use cases for this functionality in WordPress Core are being investigated. NOTE: Has a patch, but moved to WordPress 6.7.- Replace most
strip_tags()withwp_strip_tags().
There are rare occasions when thestrip_tags()function is passed a null value, which generates a warning that the string is deprecated. NOTE: Has a patch. - Update
is_serializedfunction to acceptEnums.Enumsare not backwards compatible with older PHP versions. NOTE: Has a patch, but moved to WordPress 6.7.
PHP 8.2
utf8_{encode|decode}deprecation with pending decision on requiring a PHP extension. NOTE: Has a patch, but moved to WordPress 6.7.- Unknown dynamic properties’ deprecation. NOTE: Moved to WordPress 6.7.
What “beta” mean?
PHP 8.3
- 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.
- Improve error handling for
unserialize().maybe_unserialize()function could still be confronted by data with trailing bytes. NOTE: Moved to WordPress 6.7.
Upgrading WordPress
Do you have a version earlier than WordPress 6.6? If so, we recommend you visit the Upgrading WordPress page, where you will find information on how to upgrade from WordPress 0.7 to WordPress 6.6.
Props: @luciaalcantara, @crixu, @annezazu.