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.
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: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
Specifynone 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:
Special ICU/intl versioning on Ubuntu
Theintl extension can be paired with a specific ICU version on Ubuntu for PHP 5.6 and above. Suffix intl with the ICU version:
- PHP 8.4 and lower — ICU 50.2 and newer
- PHP 8.5 and above — ICU 57.2 and newer
Platform-specific examples
Extensions with custom support
The following extensions have dedicated support beyond standard PECL installation:Ubuntu-only
Ubuntu-only
cubrid— CUBRID database extensionpdo_cubrid— PDO driver for CUBRID
Ubuntu and macOS
Ubuntu and macOS
event— libevent bindingsgearman— Gearman job server clientgeos— GEOS geometry libraryrelay— Redis client with local in-process cache
All platforms
All platforms
blackfire— Blackfire profilercouchbase— Couchbase SDKibm_db2— IBM Db2 driverioncube— ionCube Loaderoci8— Oracle Database extensionpdo_firebird— PDO driver for Firebirdpdo_ibm— PDO driver for IBM Db2pdo_oci— PDO driver for Oraclepecl_http— HTTP extensionphalcon3— Phalcon 3 frameworkphalcon4— Phalcon 4 frameworkphalcon5— Phalcon 5 frameworkzephir_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 thefail-fast flag:
Extensions loaded by default after setup-php runs are listed on the setup-php wiki.