Include all recommended WordPress libraries
The web team (cc @ldelpian and @agonzalv) have identified our image is leaner than the upstream recommended image.
to my mind we should, at least mimic the default version and include the libraries of this section install the PHP extensions we need (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions)
@fborgesa looked into this and it seems we need to include at least the libraries in https://github.com/docker-library/wordpress/blob/470084224c4a2b4f0c2e19da2af9ab96298739e4/latest/php8.2/fpm/Dockerfile
To do:
- Include all required libraries (let's leave any optional for later), following recommendations from https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions and re-using commands from https://github.com/docker-library/wordpress/blob/470084224c4a2b4f0c2e19da2af9ab96298739e4/latest/php8.2/fpm/Dockerfile for simplification
Done:
Highly recommended libraries from WP
| Library | Description | Already Present | Why is Needed |
|---|---|---|---|
| curl | Performs remote request operations. (PHP >= 7.3 requires libcurl >= 7.15.5; PHP >= 8.0 requires libcurl >= 7.29.0 ; PHP >= 8.4 requires libcurl >= 7.61.0) | - | |
| dom | Used to validate Text Widget content and to automatically configure IIS7+. (requires libxml) | - | |
| exif | Works with metadata stored in images. (requires php-mbstring) |
|
|
| fileinfo | Used to detect mimetype of file uploads. (bundled in PHP) | - | |
| hash | Used for hashing, including passwords and update packages. (bundled in PHP >=5.1.2) | - | |
| igbinary | Increases performance as a drop in replacement for the standard PHP serializer. |
|
|
| imagick | Provides better image quality for media uploads. Smarter image resizing (for smaller images) and PDF thumbnail support, when Ghost Script is also available. (requires ImageMagick >= 6.2.4) |
|
|
| intl | Enable to perform locale-aware operations including but not limited to formatting, transliteration, encoding conversion, calendar operations, conformant collation, locating text boundaries and working with locale identifiers, timezones and graphemes. (PHP >= 7.4.0 requires ICU >= 50.1) |
|
|
| mbstring | Used to properly handle UTF8 text. | - | |
| openssl | SSL-based connections to other hosts. (PHP 7.1–8.0 requires OpenSSL >= 1.0.1 / < 3.0; PHP >= 8.1 requires OpenSSL >= 1.0.2 / < 4.0; PHP >= 8.4 requires OpenSSL >= 1.1.1 / < 4.0) | - | |
| pcre | Increases performance of pattern matching in code searches. (bundled in PHP >= 7.0, recommended PCRE 8.10) | - | |
| xml | Used for XML parsing, such as from a third-party site. (requires libxml) | - | |
| zip | Used for decompressing Plugins, Themes, and WordPress update packages. (requires libzip >= 0.11; recommended libzip >= 1.6) |
|
PHP modules WordPress may use in certain situations
In our case, most of them are related to image manipulation.
| Library | Description | Already Present | Why is Needed |
|---|---|---|---|
| Ghostscript | powerful interpreter for PDF and PostScript files, and is widely used for: Rendering PDFs or PostScript files into images (like JPEG, PNG), Converting between PDF, PostScript, and image formats, Generating previews or thumbnails of PDF pages. Extracting or rasterizing pages from multipage documents |
|
|
| gd extensions .avif .webp | graphics software library for dynamically creating and manipulating images. |
|
|
| bcmath | For arbitrary precision mathematics, which supports numbers of any size and precision up to 2147483647 decimal digits. |
|
Edited by Lorenzo Del Pianta