re: PHP Extensions

Thank you to everybody who has contributed to the conversation regarding PHPPHP PHP (PHP: Hypertext Preprocessor) is a general-purpose scripting language especially suited to web development. PHP code is usually processed on a web server by a PHP interpreter. On a web server, the result of the interpreted and executed PHP code would form the whole or part of an HTTP response. extension requirements!

This post is meant to summarize the feedback had so far, and not to make recommendations at this stage.

Background

Following the release of WordPress 5.2 and Site HealthSite Health This WordPress functionality will perform a number of checks on your installation to detect common configuration errors and known issues, and also allows plugins and themes to add their own checks. Check, the hostingHosting A web hosting service is a type of Internet hosting service that allows individuals and organizations to make their website accessible via the World Wide Web. team started working on documentation to help bring clarity about requirements and recommendations to users and hosts.

The official requirements do not yet list PHP extension details. There is a meta ticket discussing how to handle this.

Site Health Check, however, lists both PHP extension requirements and recommendations via WP_Site_Health::get_test_php_extensions() in the new Site Health functionality in 5.2.

The recommendations included are extensions that are not required by coreCore Core is the set of software required to run WordPress. The Core Team builds WordPress., but are used when available to make WordPress function better.

Discussion on changing these was started in this trac ticket. While discussion is in progress, feedback was requested from hosts.

Following that, @dd32 helped with a first pass on requirements and recommended something like phpcompatinfo to check in an automated fashion. @amykamala ran phpcompatinfo as recommended, and you can check out the results in this doc.

Host Feedback

Based on feedback received in @mikeschroder‘s post regarding PHP requirements:

• 75% of feedback indicated that the handbook should make recommendations beyond the required PHP extensions.

• There was a 50/50 split on whether Site Health Check should also recommend PHP extensions beyond requirements.

• However, more than half of responses indicate that core requirements and recommendations (if provided) should both be available via Site Health.

The following extensions were suggested as additional recommendations to be made:

  • opcache
  • bcmath
  • memcache
  • memcachedMemcached Memcached is a general-purpose distributed memory-caching system. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of times an external data source must be read. Memcached is free and open-source software.
  • Intl

@peterwilsoncc recommended here that the following parameters be in place for determining what extensions are recommended:

“1. it’s used in WordPress Core
2. it’s included in the default PHP build for each version WordPress Core supports, currently the default builds for PHP 5.6+”

About Intl

There is an existing feature request for recommending the intl extension, found here.

@zodiac1978 brought up the idea of recommending intl in this github issue:

“It is necessary to use the Normalizer function which would solve many problems with internationalization issues for special characters: https://www.php.net/manual/en/intl.requirements.php

@fierevere  Pointed out that “intl has hard dependency on icu system libraries, which will consume over 30 Mb diskspace on smaller (VPSVPS A virtual private server (VPS) is a virtual machine sold as a service by an Internet hosting service. A VPS runs its own copy of an operating system (OS), and customers may have superuser-level access to that operating system instance, so they can install almost any software that runs on that OS./embedded) systems. Each loaded library claims some memory and initialization time overhead. Bigger distributions can link libicu to libxml2 library and therefore it can be loaded by libxml2 linked extensions, but this dependency is optional”

This trac ticket was re-opened and is related, in that Normalizer::normalize requires the intl and icu extensions.

@bronsonquick mentioned here that they “… had to created a new Chassis extension for PHP intl when I was working on a clients site in another language as it wasn’t bundled!”

@swissspidy brought up an important point here, stating that “an available extension does not necessarily mean that it’s working. For example, we’ve often ran into issues where hosts disable functions like curl_multi_init or even curl_init. Or, in the case of the INTL extension, when a serverServer A server is a piece of computer hardware or software that provides functionality for other programs or devices. Typical servers are database servers, file servers, mail servers, print servers, web servers, game servers, and application servers. is running PHP 7.2 but uses a super outdated version of the extension which doesn’t include the functions and constants one would expect. So any site health check for extensions should also check against these things.”

Thank you

Thank you again to everyone who contributed to the conversation regarding PHP extensions. Please feel free to add additional comments here or bring it up in the #hosting-community SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/. channel. Your feedback is important!

#php