2021-01-15 09:21:12 +01:00
[![Downloaded GitHub Releases ](https://img.shields.io/github/downloads/mlocati/docker-php-extension-installer/total?label=Downloaded%20releases )](https://github.com/mlocati/docker-php-extension-installer/releases)
[![Docker Hub pulls ](https://img.shields.io/docker/pulls/mlocati/php-extension-installer?label=Docker%20Hub%20pulls )](https://hub.docker.com/r/mlocati/php-extension-installer)
2020-02-21 13:22:59 +01:00
[![Test recent ](https://github.com/mlocati/docker-php-extension-installer/workflows/Test%20recent/badge.svg )](https://github.com/mlocati/docker-php-extension-installer/actions?query=workflow%3A%22Test+recent%22)
2018-04-12 09:25:43 +02:00
2018-04-11 17:39:10 +02:00
# Easy installation of PHP extensions in official PHP Docker images
This repository contains a script that can be used to easily install a PHP extension inside the [official PHP Docker images ](https://hub.docker.com/_/php/ ).
2020-01-08 10:09:44 +01:00
The script will install all the required APT/APK packages; at the end of the script execution, the no-more needed packages will be removed so that the image will be much smaller.
2020-03-03 12:07:51 +01:00
Supported docker images are all the Alpine/Debian versions, except for PHP 5.5 where we only support Debian 8 (jessie) (that is, `php:5.5` , `php:5.5-apache` , `php:5.5-cli` , `php:5.5-fpm` , `php:5.5-zts` ).
See also the notes in the [Special requirements ](#special-requirements ) section.
2018-04-11 17:39:10 +02:00
## Usage
2020-01-08 10:09:44 +01:00
You have two ways to use this script within your `Dockerfile` s: you can download the script on the fly, or you can grab it from the [`mlocati/php-extension-installer` Docker Hub image ](https://hub.docker.com/r/mlocati/php-extension-installer ).
With the first method you are sure you'll always get the very latest version of the script, with the second method the process is faster since you'll use a local image.
2018-04-11 17:39:10 +02:00
2020-01-08 10:09:44 +01:00
For example, here are two `Dockerfile` s that install the GD and xdebug PHP extensions:
### Downloading the script on the fly
```Dockerfile
2018-04-11 17:39:10 +02:00
FROM php:7.2-cli
2020-12-10 15:59:21 +01:00
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
2018-04-11 17:39:10 +02:00
2020-11-05 11:43:10 +01:00
RUN chmod +x /usr/local/bin/install-php-extensions & & sync & & \
2018-04-11 17:45:25 +02:00
install-php-extensions gd xdebug
2018-04-11 17:39:10 +02:00
```
2020-01-08 10:09:44 +01:00
### Copying the script from a Docker image
2019-10-09 17:11:51 +02:00
2020-01-08 10:09:44 +01:00
```Dockerfile
2019-10-09 17:11:51 +02:00
FROM php:7.2-cli
2020-12-10 15:59:21 +01:00
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
2019-10-09 17:11:51 +02:00
RUN install-php-extensions gd xdebug
```
2021-01-10 20:32:31 +01:00
#### *Beware*
*When building locally, be sure you have the latest version of the `mlocati/php-extension-installer` image by running :*
```sh
docker pull mlocati/php-extension-installer
```
*otherwise the `COPY` instruction could use a previously downloaded, outdated version of the image stored in the local docker cache.*
2021-01-26 16:58:14 +01:00
### Installing specific versions of an extension
Let users install a specific PHP module version
Test: amqp,apcu,gmagick,http,pecl_http,igbinary,memcache,mailparse,memcached,mongodb,mosquitto,msgpack,oauth,opencensus,parallel,pcov,pdo_sqlsrv,sqlsrv,propro,protobuf,pthreads,raphf,rdkafka,redis,solr,ssh2,uuid,xdebug,uopz,xhprof,yaml
2020-12-02 18:19:24 +01:00
Simply append `-<version>` to the module name.
For example:
```sh
install-php-extensions xdebug-2.9.7
```
2021-01-26 16:58:14 +01:00
The script also support resolving *compatible* versions by prefixing the version with a caret (`^`).
For example:
```sh
# Install the most recent xdebug 2.x version (for example 2.9.8)
install-php-extensions xdebug-^2
2021-01-26 17:09:14 +01:00
# Install the most recent xdebug 2.8.x version (for example 2.8.1)
2021-01-26 16:58:14 +01:00
install-php-extensions xdebug-^2.8
```
2021-07-05 17:46:58 +02:00
Pre-release versions extensions available on `PECL` can be setup by suffixing the extension's name with its state i.e `alpha` , `beta` , `rc` , `preview` , `devel` or `snapshot` .
For example:
```sh
install-php-extensions xdebug-beta
```
TIP: When the latest version available on `PECL` is not stable, and you want to keep the last stable version,
force it by suffixing the extension's name with the `stable` state.
For example:
```sh
install-php-extensions mongodb-stable
```
2021-01-26 16:58:14 +01:00
2020-12-16 11:34:30 +01:00
### Installing composer
You can also install [composer ](https://getcomposer.org/ ), and you also can specify a major version of it, or a full version.
Examples:
```sh
# Install the latest version
install-php-extensions @composer
# Install the latest 1.x version
install-php-extensions @composer -1
# Install a specific version
install-php-extensions @composer -2.0.2
```
2018-04-11 17:39:10 +02:00
## Supported PHP extensions
<!-- START OF EXTENSIONS TABLE -->
<!-- ########################################################### -->
<!-- # # -->
<!-- # DO NOT EDIT THIS TABLE: IT IS GENERATED AUTOMATICALLY # -->
<!-- # # -->
<!-- # EDIT THE data/supported - extensions FILE INSTEAD # -->
<!-- # # -->
<!-- ########################################################### -->
2021-06-30 12:44:39 +02:00
| Extension | PHP 5.5 | PHP 5.6 | PHP 7.0 | PHP 7.1 | PHP 7.2 | PHP 7.3 | PHP 7.4 | PHP 8.0 | PHP 8.1 |
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
2021-07-01 08:38:32 +02:00
| amqp | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| apcu | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| apcu_bc | | | ✓ | ✓ | ✓ | ✓ | ✓ | | |
2021-07-01 17:36:46 +02:00
| ast | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| bcmath | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| bz2 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| calendar | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| cmark | | | ✓ | ✓ | ✓ | ✓ | ✓ | | |
2021-08-02 17:07:50 +02:00
| csv | | | | | | ✓ | ✓ | ✓ | |
2021-06-30 12:44:39 +02:00
| dba | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| decimal | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| ds | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
| enchant[*](#special-requirements-for-enchant) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| ev | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-08-03 12:13:45 +02:00
| event | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| excimer | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| exif | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| ffi | | | | | | | ✓ | ✓ | ✓ |
| gd | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| gearman | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
| geoip | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | |
2021-07-01 17:36:46 +02:00
| geospatial | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| gettext | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| gmagick | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| gmp | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| gnupg | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| grpc | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| http | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| igbinary | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| imagick | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| imap | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| inotify | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| interbase | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | |
| intl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| ioncube_loader | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | |
2021-07-13 11:22:47 +02:00
| jsmin | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | |
2021-06-30 12:44:39 +02:00
| json_post | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| ldap | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| lzf | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| mailparse | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
2021-07-01 17:36:46 +02:00
| maxminddb | | | | | ✓ | ✓ | ✓ | ✓ | ✓ |
| mcrypt | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| memcache | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| memcached | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| mongo | ✓ | ✓ | | | | | | | |
2021-08-02 17:07:50 +02:00
| mongodb | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
2021-06-30 12:44:39 +02:00
| mosquitto | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | |
2021-07-01 17:36:46 +02:00
| msgpack | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| mssql | ✓ | ✓ | | | | | | | |
| mysql | ✓ | ✓ | | | | | | | |
| mysqli | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| oauth | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| oci8 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| odbc | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| opcache | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| opencensus | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| parallel[*](#special-requirements-for-parallel) | | | | ✓ | ✓ | ✓ | ✓ | | |
| pcntl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| pcov | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| pdo_dblib | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
| pdo_firebird | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| pdo_mysql | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| pdo_oci | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| pdo_odbc | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| pdo_pgsql | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 15:51:30 +02:00
| pdo_sqlsrv[*](#special-requirements-for-pdo_sqlsrv) | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| pgsql | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| propro | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | |
| protobuf | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
| pspell | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| pthreads[*](#special-requirements-for-pthreads) | ✓ | ✓ | ✓ | | | | | | |
2021-07-01 17:36:46 +02:00
| raphf | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| rdkafka | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
| recode | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | |
2021-07-01 17:36:46 +02:00
| redis | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| seaslog | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| shmop | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| smbclient | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| snmp | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| snuffleupagus | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| soap | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| sockets | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| solr | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 15:51:30 +02:00
| sqlsrv[*](#special-requirements-for-sqlsrv) | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| ssh2 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-15 11:08:40 +02:00
| stomp | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | |
2021-06-30 12:44:39 +02:00
| swoole | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
| sybase_ct | ✓ | ✓ | | | | | | | |
| sysvmsg | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| sysvsem | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| sysvshm | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| tensor | | | | | ✓ | ✓ | ✓ | ✓ | |
| tidy | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| timezonedb | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-08-01 03:32:34 +02:00
| uopz | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
2021-07-13 08:04:00 +02:00
| uploadprogress | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | |
2021-07-01 17:36:46 +02:00
| uuid | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| vips[*](#special-requirements-for-vips) | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| wddx | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | |
| xdebug | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| xhprof | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-08-02 17:48:42 +02:00
| xlswriter | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-12 09:11:20 +02:00
| xmldiff | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-08-02 17:07:50 +02:00
| xmlrpc | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
2021-06-30 12:44:39 +02:00
| xsl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-08-02 17:36:59 +02:00
| yac | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-08-02 17:07:50 +02:00
| yaml | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
2021-07-01 17:36:46 +02:00
| yar | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-06-30 12:44:39 +02:00
| zip | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 11:33:05 +02:00
| zookeeper | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2021-07-01 17:36:46 +02:00
| zstd | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
2019-12-17 10:26:35 +01:00
2021-08-03 12:13:45 +02:00
*Number of supported extensions: 111*
2018-04-11 17:39:10 +02:00
<!-- END OF EXTENSIONS TABLE -->
2018-04-12 09:50:14 +02:00
PS: the pre-installed PHP extensions are excluded from this list.
You can list them with the following command (change `php:7.2-cli` to reflect the PHP version you are interested in):
2020-02-21 20:39:09 +01:00
```
$ docker run --rm php:7.2-cli php -m
[PHP Modules]
Core
ctype
curl
date
dom
fileinfo
filter
ftp
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
sodium
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zlib
[Zend Modules]
2018-04-12 09:50:14 +02:00
```
2018-04-11 17:39:10 +02:00
2021-06-19 20:58:37 +02:00
## Configuration
The compilation of some extensions may be fine-tuned to better fit your needs by using environment variables:
| Extension | Environment variable | Description |
|---|---|---|
| lzf | IPE_LZF_BETTERCOMPRESSION=1 | By default `install-php-extensions` compiles the `lzf` extension to prefer speed over size; you can use this environment variable to compile it preferring size over speed |
2021-08-03 10:38:36 +02:00
| event | IPE_EVENT_NAMESPACE=... | By default the `event` classes are defined in the root namespace. You can use this environment variable to specify a custom namespace |
2021-06-19 20:58:37 +02:00
2018-04-11 17:39:10 +02:00
## Special requirements
2021-03-02 21:31:48 +01:00
Some extensions have special requirements:
2018-04-11 17:39:10 +02:00
<!-- START OF SPECIAL REQUIREMENTS -->
<!-- ########################################################### -->
<!-- # # -->
<!-- # DO NOT EDIT THIS TABLE: IT IS GENERATED AUTOMATICALLY # -->
<!-- # # -->
<!-- # EDIT THE data/special - requirements FILE INSTEAD # -->
<!-- # # -->
<!-- ########################################################### -->
| Extension | Requirements |
2020-03-03 12:08:17 +01:00
|---|---|
2021-01-26 14:26:11 +01:00
| < a name = "special-requirements-for-enchant" ></ a > enchant | • Not available in `7.2-alpine3.12` docker images< br /> • Not available in `7.3-alpine3.12` docker images< br /> • Not available in `7.3-alpine3.13` docker images< br /> • Not available in `7.4-alpine3.12` docker images< br /> • Not available in `7.4-alpine3.13` docker images |
2020-03-03 14:25:40 +01:00
| < a name = "special-requirements-for-parallel" > < / a > parallel | Requires images with PHP compiled with thread-safety enabled (`zts`). |
2021-01-20 14:49:07 +01:00
| < a name = "special-requirements-for-pdo_sqlsrv" ></ a > pdo_sqlsrv | • Not available in `7.0-alpine3.7` docker images< br /> • Not available in `7.1-alpine3.7` docker images< br /> • Not available in `7.1-alpine3.8` docker images< br /> • Not available in `7.2-alpine3.7` docker images< br /> • Not available in `7.2-alpine3.8` docker images< br /> • Not available in `7.3-alpine3.8` docker images |
2020-03-03 14:25:40 +01:00
| < a name = "special-requirements-for-pthreads" > < / a > pthreads | Requires images with PHP compiled with thread-safety enabled (`zts`). |
2021-01-20 14:49:07 +01:00
| < a name = "special-requirements-for-sqlsrv" ></ a > sqlsrv | • Not available in `7.0-alpine3.7` docker images< br /> • Not available in `7.1-alpine3.7` docker images< br /> • Not available in `7.1-alpine3.8` docker images< br /> • Not available in `7.1-alpine3.9` docker images< br /> • Not available in `7.1-alpine3.10` docker images< br /> • Not available in `7.2-alpine3.7` docker images< br /> • Not available in `7.2-alpine3.8` docker images< br /> • Not available in `7.3-alpine3.8` docker images |
2021-05-05 17:02:15 +02:00
| < a name = "special-requirements-for-vips" ></ a > vips | • Not available in `7.0-alpine3.7` docker images< br /> • Not available in `7.1-alpine3.7` docker images< br /> • Not available in `7.2-alpine3.7` docker images< br /> • Not available in `7.1-alpine3.8` docker images< br /> • Not available in `7.2-alpine3.8` docker images< br /> • Not available in `7.3-alpine3.8` docker images< br /> • Not available in `7.1-alpine3.9` docker images< br /> • Not available in `7.2-alpine3.9` docker images< br /> • Not available in `7.3-alpine3.9` docker images< br /> • Not available in `7.0-jessie` docker images< br /> • Not available in `7.1-jessie` docker images< br /> • Not available in `7.2-jessie` docker images |
2018-04-11 17:39:10 +02:00
<!-- END OF SPECIAL REQUIREMENTS -->
2018-04-12 11:58:21 +02:00
2020-02-21 14:05:53 +01:00
## Tests
When submitting a pull request, a [GitHub Action ](https://github.com/mlocati/docker-php-extension-installer/blob/master/.github/workflows/test-extensions.yml ) is executed to check if affected PHP extensions actually work (see below).
Furthermore, we also check that new versions of extensions in the PECL repository will still work.
This is done on a scheduled basis with another [GitHub Action ](https://github.com/mlocati/docker-php-extension-installer/blob/master/.github/workflows/test-recent-extensions.yml ).
2020-02-22 20:42:50 +01:00
In case of failure, a message is sent to a [Telegram Channel ](https://t.me/docker_php_extension_installer ).
2020-02-21 14:05:53 +01:00
Feel free to subscribe to it to receive failure notifications.
2018-04-12 11:58:21 +02:00
## How to contribute
2019-12-20 18:26:26 +01:00
### Formatting code
Before submitting any pull request, be sure to execute the `lint` script in the `scripts` directory (or `lint.bat` on Windows).
2019-12-17 10:33:20 +01:00
### Adding support to a new PHP extension?
2019-12-11 12:57:53 +01:00
2019-12-17 10:33:20 +01:00
1. change the `install-php-extensions` script
2. update the `data/supported-extensions` file, adding a new line with the handle of the extension and the list of supported PHP versions
3. if the extension requires ZTS images:
add a new line to the `data/special-requirements` file, with the extension handle followed by a space and `zts`
2019-12-17 11:21:01 +01:00
See [this pull request ](https://github.com/mlocati/docker-php-extension-installer/pull/60 ) for an example.
2019-12-17 10:33:20 +01:00
### Changing the supported PHP versions for an already supported PHP extension?
1. change the `install-php-extensions` script
2019-12-18 16:45:20 +01:00
2. update the `data/supported-extensions` file, adding the new PHP version to the existing line corresponding to the updated extension
2019-12-17 11:21:01 +01:00
See [this pull request ](https://github.com/mlocati/docker-php-extension-installer/pull/62 ) for an example.
2019-12-17 10:33:20 +01:00
### Improving code for an already supported extension?
If you change some code that affects one or more extensions, please add a line with `Test: extension1, extension2` to the message of one of the pull request commits.
That way, the test jobs will check the extension even if you don't touch the `data/supported-extensions` file.
Here's an example of a commit message:
```
Improve the GD and ZIP extensions
Test: gd, zip
```
2019-12-18 16:45:20 +01:00
Tests only check the installation of a single PHP extension at a time.
If you want to test installing more PHP extensions at the same time, use a commit message like this:
```
Improve the GD and ZIP extensions
Test: gd+zip
```
2019-12-17 10:33:20 +01:00
If your pull request contains multiple commits, we'll check the "Test:" message of every commit.
If you want to stop parsing next commits, add `-STOP-` in the "Test:" line, for example:
```
Improve the GD and ZIP extensions
Test: gd, zip, -STOP-
```
2019-12-10 08:55:09 +01:00
2019-12-17 11:21:01 +01:00
See [this pull request ](https://github.com/mlocati/docker-php-extension-installer/pull/43 ) for an example.
2021-01-31 11:41:15 +01:00
### PHP requirements and configure options
PHP extensions published on the PECL archive contain a `package.xml` (or `package2.xml` ) file describing the supported PHP versions and the options that can be used to compile it.
When we add support for a new PHP extension, and when a new version of a PHP extension is released, we have to check those constraints.
It's a rather tedious taks, so I developed a project that lets you easily check those constraints: you can find it at https://mlocati.github.io/pecl-info ([here](https://github.com/mlocati/pecl-info) you can find its source code).
2021-01-14 15:47:44 +01:00
## For the maintainers
See the [`MAINTAINERS.md` ](https://github.com/mlocati/docker-php-extension-installer/blob/master/MAINTAINERS.md ) file.
2019-12-10 08:55:09 +01:00
## Do you want to really say thank you?
You can offer me a [monthly coffee ](https://github.com/sponsors/mlocati ) or a [one-time coffee ](https://paypal.me/mlocati ) :wink: