Skip to main content
The extensions input accepts a comma-separated list of PHP extensions to install or disable. setup-php handles package resolution, PECL installation, and compilation automatically depending on the platform.

Basic usage

How extensions are installed per platform

Ubuntu

Extensions available as OS packages, on PECL, or in a git repository can be installed.

Windows

Extensions available on PECL that have a prebuilt DLL binary can be installed.

macOS

Extensions available on PECL or in a git repository can be installed.
On Ubuntu and macOS you can compile and install an extension from a git repository or from PECL with custom libraries and configuration. See the setup-php wiki for guides.
Extensions that are installed alongside PHP are automatically enabled when specified in the extensions input.

Installing extensions from PECL

PECL extensions are referenced by name:

Specific extension versions

Suffix an extension name with the version number to install a specific release from PECL. This is useful for running end-of-life PHP versions that require older extension releases:

Pre-release versions

Suffix an extension name with its stability state to install a pre-release build from PECL:
Accepted stability suffixes: alpha, beta, devel, snapshot.

Disabling extensions

Disable a specific extension

Prefix an extension name with : to disable it. All extensions that depend on the disabled extension are also disabled:

Disable all shared extensions

Specify none to disable every shared extension. When none appears alongside other extension names, it is hoisted to run first — disabling everything — then the remaining extensions are processed:
none disables all core and third-party shared extensions, which can break tools that depend on them. When tools are set up, required extensions are re-enabled on a best-effort basis. Always list any extensions your tools need after none to avoid issues.

Special ICU/intl versioning on Ubuntu

The intl extension can be paired with a specific ICU version on Ubuntu for PHP 5.6 and above. Suffix intl with the ICU version:
Supported ICU version ranges:
  • PHP 8.4 and lower — ICU 50.2 and newer
  • PHP 8.5 and above — ICU 57.2 and newer
Refer to the icu-intl builds list for the exact versions available.

Platform-specific examples

Extensions with custom support

The following extensions have dedicated support beyond standard PECL installation:
  • cubrid — CUBRID database extension
  • pdo_cubrid — PDO driver for CUBRID
  • event — libevent bindings
  • gearman — Gearman job server client
  • geos — GEOS geometry library
  • relay — Redis client with local in-process cache
  • blackfire — Blackfire profiler
  • couchbase — Couchbase SDK
  • ibm_db2 — IBM Db2 driver
  • ioncube — ionCube Loader
  • oci8 — Oracle Database extension
  • pdo_firebird — PDO driver for Firebird
  • pdo_ibm — PDO driver for IBM Db2
  • pdo_oci — PDO driver for Oracle
  • pecl_http — HTTP extension
  • phalcon3 — Phalcon 3 framework
  • phalcon4 — Phalcon 4 framework
  • phalcon5 — Phalcon 5 framework
  • zephir_parser — Zephir parser

Fail-fast behavior

By default, if an extension cannot be added or disabled, setup-php logs an error but continues without interrupting the workflow. To make the workflow fail instead, set the fail-fast flag:
Extensions loaded by default after setup-php runs are listed on the setup-php wiki.