As we explained in previous posts (WordPress 6.6, 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.7.
Hosting Team Recommendation
The Hosting Team’s recommendations for WordPress 6.7 are as follows (which may differ from the global ones).
- PHP: 8.2.x, 8.3.x
- MySQL: 8.0.x, 8.4.x
- MariaDB: 10.11.x, 11.4.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.7 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.7 (released on November 12, 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), 8.3 (Active Support), and 8.4 (Candidate Support).
- MySQL: 8.0 (LTS), 8.4 (LTS), and 9.1.
- MariaDB: 10.5 (LTS), 10.6 (LTS), 10.11 (LTS), 11.4 (LTS), and 11.5.
- 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.7 (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, and 8.4.
(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.
Looking for all the tickets? Check this Trac PHP Search.
What “compatible with exceptions” mean?
PHP 8.0
- #48689: 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. NOTE: Has a patch.
- #49728: Prepare for the internal functions throwing TypeError or ValueError exceptions 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.
- #51019: convert_smilies() fails on large tags. The function fails when dealing with large HTML tags, particularly when an image with a large data URL is included in the post content. NOTE: Has a patch, but moved to WordPress 6.8.
- #55121: classic widgets with no settings won’t show up in 5.9. Classic widgets with no settings do not appear correctly in WordPress 5.9 and above. This is due to changes in how widgets are handled in the block editor, causing compatibility problems with older widget setups. NOTE: Has a patch, but moved to WordPress 6.3.
- #55257: map_deep() function incompatibility with incomplete objects in PHP 8.0+. The function becomes incompatible with incomplete objects when running on PHP 8.0 or higher. NOTE: Has a patch, but moved to Future Release.
- #59649: 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.8.
- #60745: WP_Query::parse_query() does not handle invalid query arg values. The function does not properly handle invalid query argument values. This results in PHP fatal errors when unintended data types, like arrays, are passed where scalars are expected. NOTE: Has a patch, but moved to WordPress 6.8.
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”.
- #53465: 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_COMPATtoENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401“. All use cases for this functionality in Core are being investigated. NOTE: Has a patch. - #57579: Replace most strip_tags() with wp_strip_tags(). Proposes optimizing how block templates are handled by minimizing unnecessary filesystem calls during their loading process. NOTE: Has a patch, but moved to Future Release.
- #57580: Avoid errors from null parameters in add_submenu_page(). A deprecated error caused by the
wp_normalize_path()function when null is passed as an argument. This issue occurs primarily due to plugins incorrectly passing null in theadd_submenu_page()function. NOTE: Has a patch, but moved to Future Release. - #61179: Deprecated messages about passing null in widgets.php Addresses a deprecated message issue in
widgets.php. NOTE: Has a patch, but moved to WordPress 6.7.
PHP 8.2
- #55603: utf8_{encode|decode} deprecation with pending decision on requiring a PHP extension. NOTE: Has a patch, but moved to WordPress 6.8.
- #56034: Unknown dynamic properties’ deprecation. NOTE: Moved to Future Release.
- #57304: Add SensitiveParameter attribute to DB connection and login variables. This enhancement aims to protect sensitive data in case of errors, making it less likely to be exposed in logs or bug reports. NOTE: Moved to WordPress 6.7.
- #60875: Handler proposal for known dynamic properties that are initialized and set late only when getting its value. Handling dynamic properties that are initialized only when accessed. Since PHP 8.2 deprecates dynamic (non-declared) properties, the proposal aims to pre-declare these properties while retaining the current design where they are lazily initialized. NOTE: Moved to WordPress 6.8.
- #61154: Fix the ‘attributes’ dynamic property in WP_Block. Fixing the ‘attributes’ dynamic property in the
WP_Blockclass. NOTE: Has a patch, but moved to WordPress 6.8. - #61890: Handle WP_Term dynamic properties for PHP 8.2. Handling of dynamic properties in the
WP_Termclass to ensure compatibility. NOTE: Has a patch, but moved to WordPress 6.8.
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.
- #59231: Prepare for PHP 8.3.. NOTE: Has a patch, but moved to WordPress 6.7.
- #59232: Introduce #[Override] attribute to mark overloaded methods This attribute helps prevent coding errors by making it clear when a method is overloaded. It also assists with refactoring, debugging, and catching potential breaking changes in the parent class. NOTE: Has a patch, but moved to Future Release.
- #59233: Improve error handling for unserialize().
maybe_unserialize()function could still be confronted by data with trailing bytes. NOTE: Moved to Future Release. - #59654: PHP 8.x: various compatibility fixes for WordPress 6.7. This ticket acts as a central hub for smaller patches that fix specific PHP 8.x failures. It continues the work from previous releases, ensuring that WordPress maintains compatibility with newer PHP versions like PHP 8.0, 8.1, 8.2, and upcoming versions like PHP 8.3. NOTE: Moved to WordPress 6.7.
PHP 8.4
- 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.
- #62061: Prepare for PHP 8.4.. NOTE: Has a patch.
Other related tickets
PHP
- #51525: Add new functions apply_filters_single_type() and apply_filters_ref_array_single_type().
- #54183: Tests: decide on how to handle deprecations in PHPUnit
- #54537: Tests: Enable PHP version check once PHP 8.0 compatibility is achieved.
- #58874: Code Modernization: Consider using the null coalescing operator.
- #59234: Introduce a
wp_json_decode()function, including validation when available
Upgrading WordPress
Do you have a version earlier than WordPress 6.7? 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.7.