Search by

mlocati / install-php-extensions

mlocati

Easily install PHP extensions

Package info

github.com/mlocati/install-php-extensions

Type:project

pkg:composer/mlocati/install-php-extensions

Fund package maintenance!

mlocati

paypal.me/mlocati

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 16

Open Issues: 2

0.1.2 2026-11-06 14:07 UTC

This package is auto-updated.

Last update: 2026-11-08 12:46:18 UTC


README

Tests

Warning

IPE is still in alpha: its options, its behavior and the library API may change without notice, and some extensions may not install correctly. For production use, consider docker-php-extension-installer for the time being.

install-php-extensions (IPE) installs PHP extensions with a single command: it chooses a version of the extensions that is compatible with your PHP, installs the system packages they need, compiles them and enables them.

It works on Debian and Alpine Linux, in the official Docker PHP images as well as in other PHP installations.

install-php-extensions gd xdebug

Getting IPE

IPE is distributed as a PHAR file attached to the releases, in two variants:

  • install-php-extensions: not compressed;
  • install-php-extensions-gz: smaller, but it requires the zlib PHP extension (which should be always available in the official Docker PHP images).

Both the PHAR files are also available in the ghcr.io/mlocati/install-php-extensions Docker image.

Downloading IPE with ADD

FROM php:8.4-cli

ADD --chmod=0755 https://github.com/mlocati/install-php-extensions/releases/latest/download/install-php-extensions /usr/local/bin/

RUN install-php-extensions gd xdebug

Downloading IPE with curl

FROM php:8.4-cli

RUN curl -sSLf \
        -o /usr/local/bin/install-php-extensions \
        https://github.com/mlocati/install-php-extensions/releases/latest/download/install-php-extensions-gz && \
    chmod +x /usr/local/bin/install-php-extensions && \
    install-php-extensions gd xdebug

The same commands work outside Docker too (IPE must be run as root, since it installs system packages).

Copying IPE from the Docker image

FROM php:8.4-cli

COPY --from=ghcr.io/mlocati/install-php-extensions:latest /usr/bin/install-php-extensions /usr/local/bin/

RUN install-php-extensions gd xdebug

The image is available for all the platforms of the official Docker PHP images. It also contains the compressed variant, /usr/bin/install-php-extensions-gz (which requires the zlib PHP extension):

COPY --from=ghcr.io/mlocati/install-php-extensions:latest /usr/bin/install-php-extensions-gz /usr/local/bin/install-php-extensions

Using a specific version of IPE

The URLs and the image above provide the most recent release of IPE, so a new release may change what your builds do. To always use the same version, replace latest/download with download/<version>, where <version> is the version of a release (for example 0.0.1):

ADD --chmod=0755 https://github.com/mlocati/install-php-extensions/releases/download/0.0.1/install-php-extensions /usr/local/bin/

Likewise, replace the latest tag of the Docker image with the version (for example 0.0.1). The image is also tagged with the major and minor versions (for example 1.2 for the most recent 1.2.x release) and, starting from version 1, with the major version (for example 1).

COPY --from=ghcr.io/mlocati/install-php-extensions:0.0.1 /usr/bin/install-php-extensions /usr/local/bin/

Pre-releases (like 1.0.0-beta1) are never provided by the latest URLs and tags: you can use them only by specifying their version.

Building IPE

You can also build the PHAR files from the source code (you need PHP with the phar.readonly setting turned off, which the build-phar Composer script does for you):

git clone https://github.com/mlocati/install-php-extensions.git
cd install-php-extensions
composer install --no-dev
# Not compressed
composer run-script build-phar -- install-php-extensions
# Compressed with gzip
composer run-script build-phar -- --compress=gz install-php-extensions-gz

Specifying the extensions

Every argument identifies an extension to be installed:

Argument Example Description
Handle xdebug One of the supported PHP extensions: depending on the extension and on the PHP version, IPE takes it from the PHP source code, from Packagist/Composer or from PECL
Composer package vendor/name A PHP extension published as a Composer package on Packagist (like the ones installed by PIE)
GitHub shortcut gh:organization/repository@ref The source code of a GitHub repository, where ref is a commit, a tag or a branch
URL https://example.com/extension.tar.gz An archive containing the source code of the extension
Local directory ./path/to/extension A directory containing the source code of the extension (the path must start with /, ./ or ../)

If the source code is not in the root directory of the GitHub repository or of the archive, append # followed by its path, for example:

  • gh:organization/repository@main#path/to/extension
  • https://example.com/archive.tar.gz#path/to/extension

Specifying the versions

By default, IPE installs the most recent stable version of the extensions compatible with your PHP (some extensions use a different default for some PHP versions).

To choose a version of an extension specified with its handle or with its Composer package name, append : followed by the version requirements, using the Composer syntax:

Warning

The arguments containing spaces or characters like *, <, > and | must be quoted, for example 'xdebug:3.3.*' or 'xdebug:>=3.2 <3.4'.

Argument Installed version
xdebug:^3.3 The most recent 3.x version, starting from 3.3.0
xdebug:~3.3.0 or xdebug:3.3.* The most recent 3.3.x version
xdebug:3.3.2 Exactly 3.3.2
xdebug:3.4.0beta1 Exactly 3.4.0beta1
xdebug:@beta The most recent version whose stability is beta or better
xdebug:^3.4@RC The most recent 3.x version, starting from 3.4.0, whose stability is RC or better

Please remark that:

  • the stability levels are, from the lowest to the highest, dev, alpha, beta, RC and stable: without @, only stable versions are considered
  • a version without operators is an exact version: xdebug:3.3 means 3.3.0, not the most recent 3.3.x version
  • exact versions are installed whatever their stability, and without checking if they are compatible with your PHP
  • for the extensions bundled with PHP, the version is the one of PHP: if it doesn't satisfy the requirements, IPE looks for the extension in the other sources

Supported PHP extensions

The extensions marked with ⓘ have some notes.

Extension PHP 8.6 PHP 8.5 PHP 8.4 PHP 8.3 PHP 8.2 PHP 8.1 PHP 8.0 PHP 7.4 PHP 7.3 PHP 7.2 PHP 7.1 PHP 7.0 PHP 5.6 PHP 5.5
amqp ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
apcu ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
apcu_bc ✓ ✓ ✓ ✓ ✓
ast ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
bcmath ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
bitset ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
blackfire ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
brotli ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
bz2 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
calendar ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
cassandraⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
cmark ✓ ✓ ✓ ✓ ✓
csv ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
dba ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
ddtraceⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
decimal ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
ds ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
ecma_intlⓘ ✓ ✓
enchant ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
ev ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
event ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
excimer ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
exif ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
ffi ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
ftp ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
gdⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
gearman ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
geoip ✓ ✓ ✓ ✓ ✓ ✓ ✓
geosⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
geospatial ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
gettext ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
gmagick ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
gmp ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
gnupg ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
grpc ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
http ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
igbinary ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
imagick ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
imap ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
inotify ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
interbase ✓ ✓ ✓ ✓ ✓ ✓
intl ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
ion ✓ ✓ ✓ ✓ ✓
ioncube_loader ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
ip2location ✓ ✓ ✓ ✓ ✓ ✓ ✓
jsmin ✓ ✓ ✓ ✓ ✓ ✓ ✓
json_post ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
jsonpath ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
judyⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓
ldap ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
luasandbox ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
lz4ⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
lzf ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
mailparse ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
maxminddb ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
mbstring ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
mcrypt ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
md4c ✓ ✓ ✓ ✓ ✓ ✓ ✓
memcache ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
memcached ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
memprofⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
mongo ✓ ✓
mongodb ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
mosquitto ✓ ✓ ✓ ✓ ✓ ✓ ✓
msgpack ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
mssql ✓ ✓
mysql ✓ ✓
mysqli ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
newrelicⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
nsq ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
oauth ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
oci8ⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
odbc ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
opcache ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
opencensus ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
openswoole ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
opentelemetry ✓ ✓ ✓ ✓ ✓ ✓ ✓
operatorⓘ ✓ ✓ ✓ ✓
parallelⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
parleⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pcntl ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pcov ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pdo_dblib ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pdo_firebird ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pdo_mysql ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pdo_ociⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pdo_odbc ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pdo_pgsql ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pdo_snowflakeⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pdo_sqlsrvⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pgsql ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
phalcon ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
php_trie ✓ ✓ ✓ ✓ ✓ ✓ ✓
phpyⓘ ✓ ✓ ✓ ✓ ✓
pkcs11 ✓ ✓ ✓ ✓ ✓ ✓ ✓
pq ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
propro ✓ ✓ ✓ ✓ ✓ ✓ ✓
protobuf ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pspell ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
psr ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
pthreadsⓘ ✓ ✓ ✓
raphf ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
rdkafka ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
recodeⓘ ✓ ✓ ✓ ✓ ✓ ✓
redis ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
relayⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓
rrd ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
saxonⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
seasclickⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
seaslog ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
shmop ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
simdjsonⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
smbclient ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
snappy ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
snmp ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
snuffleupagusⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
soap ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
sockets ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
sodiumⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
solr ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
sourceguardian ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
spx ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
sqlsrvⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
ssh2 ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
statgrabⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓
stomp ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
swooleⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
sybase_ct ✓ ✓
sync ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
sysvmsg ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
sysvsem ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
sysvshm ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
tensor ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
tideways ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
tidy ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
timezonedb ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
translit ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
uopz ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
uploadprogress ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
uuid ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
uv ✓ ✓ ✓ ✓ ✓ ✓ ✓
v8jsⓘ ✓ ✓ ✓ ✓ ✓ ✓
vipsⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
vld ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
wddx ✓ ✓ ✓ ✓ ✓ ✓
wikidiff2ⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
xattr ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
xdebug ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
xdiff ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
xhprof ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
xlswriter ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
xmldiff ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
xmlrpc ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
xpassⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓
xsl ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
yac ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
yajl_stream ✓ ✓ ✓ ✓
yaml ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
yar ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
zephir_parser ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
zip ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
zmq ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
zookeeperⓘ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
zstd ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓

Number of supported extensions: 164

Command line options

These options apply to all the extensions (the options of specific extensions are listed in the extension notes):

Option Description Default
--php[=]value The php command (or the path of the PHP CLI binary) for which the extensions should be installed the PHP running install-php-extensions
--from-composer-json[=value] Also install the extensions listed in the require and require-dev sections of a composer.json file composer.json in the current directory
--from-composer-lock[=value] Also install the extensions required by the project and by its dependencies, as listed in a composer.lock file composer.lock in the current directory
--no-dev Ignore the development requirements of the project in --from-composer-json and --from-composer-lock
--ignore-unknown-extensions Ignore unknown extensions instead of aborting
--unsupported-extensions[=]<abort|force|skip> What to do with extensions that are known not to work in the current environment. abort
--build-type[=]<optimized|with-symbols|debug> How to compile the extensions: optimized (debug symbols stripped), with-symbols (optimized, keeping the debug symbols), debug (no optimizations, with debug symbols) optimized
--cpus[=]value Number of parallel processors to be used while compiling (0: all the available ones) all the available ones
--skip-check Don't check that PHP loads the extensions correctly before enabling them
--dont-enable Disable the extensions at the end of the installation (they can be enabled later with --enable)
--enable[=]value Enable the extension loaded by this ini file, by uncommenting its extension= and zend_extension= lines (can be specified multiple times)
--disable[=]value Disable the extension loaded by this ini file, by commenting out its extension= and zend_extension= lines (can be specified multiple times)
--ini-basename[=]value The name of the ini files that enable the extensions (without .ini): use the {priority} and {name} placeholders, or compat for the names used by the official Docker PHP images (see https://github.com/mlocati/install-php-extensions#names-of-the-ini-files) compat in the official Docker PHP images, {priority}-{name} otherwise
--keep-systempackager-cache[=]<yes|no> Keep the system packager (APT/APK) cache after installing PHP extensions no in the official Docker PHP images, yes otherwise
--apt-debian-fix-archived[=]<yes|no> Update the APT repositories for archived Debian systems yes in the official Docker PHP images, no otherwise
--apt-debian-archiveurl-default[=]value The URL for APT for archived Debian systems http://archive.debian.org/debian
--apt-debian-archiveurl-security[=]value The security URL for APT for archived Debian systems http://archive.debian.org/debian-security
--apt-debian-archiveurl-updates[=]value The updates URL for APT for archived Debian systems http://archive.debian.org/debian
--no-proxy Don't use the proxy configured in the HTTP_PROXY (or http_proxy) environment variable
--insecure Don't verify the TLS certificates of the servers when downloading files
--fix-letsencrypt[=]<yes|no> Fix the root CA certificate of Let's Encrypt on old systems yes in the official Docker PHP images, no otherwise
--cache-dir[=]value The path to an existing writable directory for dowloaded files cache
--cache-maxage[=]value The maximum age of cached files (e.g. '30' or '30s' for 30 seconds, '8h' for 8 hours, '7d' for 7 days). With 0 they never expire, so new versions of the extensions won't be detected 0
--temp-dir[=]value The path to an existing writable directory where temporary files should be stored
--verbose Print debug information
--save-report-to[=]value Write to this file a JSON report of what has been installed, and how
--save-persistent-packages-to[=]value Write to this file the space-separated list of the system packages that have been installed and kept after the installation
--save-volatile-packages-to[=]value Write to this file the space-separated list of the system packages that have been installed and removed after the installation
--install-composer Install Composer
--composer-path[=]value The directory (or full path) where Composer should be installed (must be specified on Windows)
--composer-version[=]value The Composer version to be installed (stable, 1, 2.2, 2, 2.9.1, ...) stable

Names of the ini files

--ini-basename sets the name of the ini files that enable the extensions (without .ini), with these placeholders:

  • {priority}: the priority of the extension, from 10 to 99 (80 for most extensions), so that the extensions are loaded in the right order
  • {name}: the name of the extension

Each placeholder must be used once, {priority} before {name}. The other characters can be letters, digits, _, - and ., but the name can't start or end with a dot. For example, with the default {priority}-{name} the calendar extension is enabled by 80-calendar.ini.

In the official Docker PHP images the default is compat: the ini files are named like the ones created by docker-php-ext-enable (docker-php-ext-<name>.ini), or xx-php-ext-<name>.ini for the extensions that must be loaded after the others.

Extension notes

Some extensions have limitations, or specific command line options:

cassandra

Not available on Debian 8 to 9 (the extension can't be compiled with the compiler or the libraries of this system)

ddtrace

Not available on Debian 8 (the extension can't be installed on this system)

Command line options:

Option Description Default
--ddtrace:enable-appsec Enable the application security module
--ddtrace:enable-profiling Enable the profiling module

ecma_intl

Not available on:

  • Debian 10 to 11 (the extension is not compatible with the version of the ICU library of this system)
  • Debian 13 (the extension is not compatible with the version of the ICU library of this system)
  • Alpine 3.22 to 3.24 (the extension is not compatible with the version of the ICU library of this system)

gd

Command line options:

Option Description Default
--gd:without-avif Skip the AVIF support if it would require compiling libaom, libyuv and libavif

geos

Not available on:

  • Alpine 3.0 to 3.8 (this system doesn't provide the GEOS library)
  • Alpine 3.9 to 3.10 (the extension can't be compiled with the compiler or the libraries of this system)

judy

Not available on Alpine 3.13 to 3.15 (the extension can't be compiled with the compiler or the libraries of this system)

lz4

Not available on:

  • Alpine 3.0 to 3.8 (the version of the LZ4 library of this system is too old)
  • Debian 8 (the version of the LZ4 library of this system is too old)

memprof

Not available on:

  • thread-safe (ZTS) builds of PHP
  • Alpine 3.0 to 3.8 (this system doesn't provide the Judy library)
  • Alpine 3.9 to 3.15 (the extension can't be compiled with the compiler or the libraries of this system)

newrelic

Not available on thread-safe (ZTS) builds of PHP

Command line options:

Option Description Default
--newrelic:install-daemon Also install the New Relic daemon
--newrelic:keep-log Keep the log file of the New Relic installer

oci8

Command line options:

Option Description Default
--oci8:with-oci8[=]value The kind and the path of the Oracle client

operator

Not available on thread-safe (ZTS) builds of PHP

parallel

Not available on non-thread-safe (NTS) builds of PHP

parle

Not available on Debian 8 (the extension can't be compiled with the compiler or the libraries of this system)

pdo_oci

Command line options:

Option Description Default
--pdo_oci:with-pdo-oci[=]value The kind and the path of the Oracle client

pdo_snowflake

Not available on:

  • Alpine (the vendor only supports glibc)
  • Debian 8 (the extension requires OpenSSL 1.1)

pdo_sqlsrv

Not available on Alpine 3.7 to 3.8 (the Microsoft ODBC Driver requires unixODBC 2.3.6 or later)

phpy

Not available on Debian 10 (the version of Python of this system is too old)

pthreads

Not available on non-thread-safe (NTS) builds of PHP

recode

Not available on Alpine 3.11 to 3.15 (the recode 3.7 library provided by this system does not work)

relay

Not available on:

  • Alpine 3.10 to 3.16 with PHP ZTS (the vendor doesn't publish ZTS builds for this system)
  • Alpine 3.17 with PHP ZTS (the ZTS build requires the ck library, which is not available)
  • Alpine 3.22 to 3.24 with PHP ZTS (the ZTS build requires libhiredis 1.1.0, which is not available)
  • Debian 10 to 11 with PHP ZTS (the vendor doesn't publish ZTS builds for this system)
  • Debian 12 with PHP ZTS (the ZTS build requires libhiredis 1.1.0, which is not available)

saxon

Not available on Alpine with PHP 7 (the source code of SaxonC does not compile (int64_t is not defined))

Command line options:

Option Description Default
--saxon:edition[=]value The edition to be installed: EE (Enterprise), PE (Professional) or HE (Home) EE

seasclick

Not available on Alpine 3.23 to 3.24 (the extension can't be compiled with the compiler or the libraries of this system)

simdjson

Not available on Debian 8 to 9 (the extension can't be compiled with the compiler or the libraries of this system)

snuffleupagus

IPE installs snuffleupagus with its default rules, which also block IPE itself. To run IPE again after snuffleupagus has been installed, you have two options:

  • run it with the rules disabled: php -d sp.configuration_file= /usr/local/bin/install-php-extensions ...
  • install snuffleupagus with the --snuffleupagus:allow-ipe option.

The --snuffleupagus:allow-ipe option adds to the rules some exceptions for the files of IPE, using the path where IPE is when it installs snuffleupagus (if you later run IPE from another path, it will be blocked). Since snuffleupagus ignores the function_r() rules for the functions that have function() rules, IPE adds an exception for every function mentioned in the default rules.

Please remark that, with this option, any PHP code can bypass the rules of snuffleupagus by including the files of IPE and using its classes: delete IPE when you no longer need it (or remove the exceptions between # BEGIN install-php-extensions rules and # END install-php-extensions rules at the beginning of the snuffleupagus.rules file).

The option is available only when running IPE as a program (bin/install-php-extensions or the phar): when using IPE as a library, it's up to you to handle the rules of snuffleupagus (see LIBRARY.md).

Not available on thread-safe (ZTS) builds of PHP

Command line options:

Option Description Default
--snuffleupagus:allow-ipe Let install-php-extensions bypass the default rules (any PHP code could do the same by using its files: delete install-php-extensions when you no longer need it)

sodium

Not available on Debian 8 (libsodium 1.0.0 is too old - at least 1.0.9 is required)

sqlsrv

Not available on Alpine 3.7 to 3.8 (the Microsoft ODBC Driver requires unixODBC 2.3.6 or later)

statgrab

Not available on Alpine 3.12 to 3.16 (the extension can't be compiled with the compiler or the libraries of this system)

swoole

Command line options:

Option Description Default
--swoole:without-iouring Don't enable the io_uring support

v8js

Not available on:

  • Debian 10 to 11 (the version of the V8 library of this system is too old)
  • Alpine 3.12 to 3.18 (the version of the V8 library of this system is too old)

vips

Not available on:

  • Alpine 3.9 (the extension can't be compiled with the compiler or the libraries of this system)
  • Debian 8 (the extension can't be compiled with the compiler or the libraries of this system)

wikidiff2

Not available on Debian 8 to 9 (the extension can't be compiled with the compiler or the libraries of this system)

xpass

Not available on Debian 10 (the extension can't be compiled with the compiler or the libraries of this system)

zookeeper

Not available on thread-safe (ZTS) builds of PHP 8.2, 8.3, 8.4, 8.5

System dependencies

Some system dependencies can be customized with these command line options:

Dependency Option Description Default
lib-aspell --lib-aspell:languages[=]value The comma-separated list of the languages of the dictionaries to be installed en
lib-icu --lib-icu:en-only Install a smaller, English-only, ICU library on Alpine 3.16 and later
oracle-instantclient --oracle-instantclient:basic Install the Basic package instead of the much smaller Basic Light one

Contributing

See CONTRIBUTING.md.

Usage as a PHP library

See LIBRARY.md.

Do you want to really say thank you?

You can offer me a monthly coffee or a one-time coffee 😉