Repository navigation
Releases: shivammathur/setup-php
Release list
2.40.0
Changelog
- Added support for PHP 8.7 nightly builds. This installs PHP builds from the master branch of
php/php-src.
- name: Setup PHP 8.7
uses: shivammathur/setup-php@v2
with:
php-version: '8.7'-
Added support for Ubuntu 26.04 (
ubuntu-26.04). (#1083) -
Added support for pinning tools to SHA-256 and SHA-512 checksums. (#1098, #1099)
- name: Setup PHP with tools pinned to checksums
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
tools: >
composer:2.9.8@sha256:59b2c50e10cafa0d8efc19ede9a326d782f096c674a26baf98cf042ce23de890,
phpunit:12.5.0@sha512:76430b433bd57f96e5fbbabaefc0c82e3a5b19b1a366bd836614344c441a7a87575d77faa07e0e58ecec52061af67584b036adc4311f0764bd4414bc62be4684-
Fixed support for Couchbase, Oracle, and IBM extensions on Ubuntu 26.04. (#1123)
-
Added support for
cpx. (#1104)
- name: Setup PHP with cpx
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
tools: cpx- Added support for Laravel Cloud CLI. (#1106)
- name: Setup PHP with Laravel Cloud CLI
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
tools: laravel-cloud- Added configurable verbose logging using the
verboseenvironment variable. Set it totrueorvto show command output, orvvorvvvto also enable tracing. Also, deprecated theverboseandmore-verbosetags in favor of this environment variable. (#1077, #1118, #1119)
- name: Setup PHP with verbose logging
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
env:
verbose: true- Improved support for PHP version files, including version aliases, partial versions, and comments. For example, a
.php-versionfile containing8.xcan now be used to set up the latest stable PHP 8 version. (#1121)
- name: Checkout
uses: actions/checkout@v7
- name: Setup PHP from a version file
uses: shivammathur/setup-php@v2
with:
php-version-file: '.php-version'-
Improved PHP installation on macOS using cached builds from
shivammathur/php-darwin. This should improve the setup-php runtime from around a minute to 5-10s. -
Improved Homebrew extension installation, timeout handling, and retries. (#1120)
-
Improved PHP installation on Windows using release manifests and cached builds from
shivammathur/php-builder-windows. -
Improved caching and validation of versioned extensions on Linux, macOS, and Windows. (#1108)
-
Added opt-in support for cached PHP builds on Blacksmith and Depot runners using
use_builds_cacheenvironment variable. This is currently experimental and uses the builds cache that we maintain for GitHub hosted runners. (#1056, #1129)
- name: Setup PHP with cached builds
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
env:
use_builds_cache: true-
Switched to Homebrew extension packages for Lua and GEOS extensions on supported macOS PHP versions.
-
Deprecated support for Intel macOS and macOS 14 arm64 runners. It is recommended to upgrade to arm64 based macOS runners (macos-15 or newer). (#1112)
-
Updated Node.js dependencies and internal GitHub Actions workflows.
For the complete list of changes, please refer to the Full Changelog
Thanks @kmaeda-rakus, @jrfnl, @WendellAdriel, @damiantw, @ibrahimlawal-paystack, @Perlence, and @Sainan for the contributions.
Follow for updates
2.40.0-beta
setup-php 2.40.0 is ready for beta testing, and we need your help to try it in your workflows and report any issues.
Please try it out!
- Use
shivammathur/setup-php@2.40.0-betato test this release.
- name: Setup PHP
uses: shivammathur/setup-php@2.40.0-beta
with:
php-version: '8.5'- Switch back to
shivammathur/setup-php@v2if anything breaks. - Report any issues, mentioning that you tried the 2.40.0 beta and including your workflow and relevant logs.
Highlights
- Added support for PHP 8.7 nightly builds and Ubuntu 26.04.
- Improved PHP installation on macOS and Windows along with extension caching support.
- Fixed support for Intel macOS and macOS 14 arm64 based runners.
- Added configurable verbose logging and improved PHP version file support.
Note
Support for intel macOS and macOS 14 arm64 based runners has been marked as deprecated and will be removed completely in future, so it is recommend to switch to arm64 based macOS runners (macos-15 or newer).
For the complete list of changes, please refer to the Full Changelog
Follow for updates
2.37.2
Changelog
-
Fixed macOS setup by marking
shivammathur/phpandshivammathur/extensionsas trusted taps. -
Switched to Visual Studio 18
(vs18)builds for PHP 8.6 on Windows. -
Improved looking up environment variables.
-
Tightened security in internal GitHub action workflows.
-
Updated Node.js dependencies.
For the complete list of changes, please refer to the Full Changelog
Follow for updates
2.37.1
Changelog
Security Updates
- Fixed shell command escaping and PHP version input validation. (GHSA-pqwm-q9pv-ph8r / CVE-2026-46420)
Note
This can affect workflows that pass values from users or pull requests to setup-php, for example from comments, dispatch inputs, PR titles/branches, generated matrices, or files such as .php-version and composer.json.
Be especially careful with pull_request_target workflows that use any value from the pull request. Workflows that only use fixed trusted values are not expected to be affected, but updating to 2.37.1 is recommended.
- Fixed GitHub auth handling for Composer versions affected by GHSA-f9f8-rm49-7jv2. It should now skip configuring GitHub OAuth if affected Composer versions are installed and show a warning to upgrade. (GHSA-5wxr-w449-57cm / CVE-2026-45793)
Note
This only affects workflows where the composer version is pinned like composer:2.9.7, workflows that do not pin the version or use composer:v2 are not affected as those get automatic updates. In case you pin the version, it is highly recommended to upgrade and have automation to do such timely upgrades in your workflows.
Fixes and Improvements
-
Fixed support for
phalconon Windows. -
Fixed restoring tools when using cached using previous runs.
-
Improved enabling
gearmanextension on Linux. -
Fixed fallback when installing
PhpManagerandVcRedistmodules on Windows. -
Fixed parsing extension inputs with backslash line continuation.
-
Improved workflow examples
- Added workflow examples for Drupal 11 composer-managed projects and WordPress plugins.
- Added workflow examples for Yii3 web applications and replaced Yii2 Starter Kit examples.
- Updated workflow examples to use currently supported PHP versions.
-
Updated OS release mappings for newer Ubuntu releases.
-
Updated internal workflows for Codecov v6 and NPM trusted publishing.
-
Updated Node.js dependencies.
-
Fixed composer version in README. (#1081)
Thanks @Pyker for the contribution
For the complete list of changes, please refer to the Full Changelog
Follow for updates
2.37.0
Changelog
-
Updated the action to use Node.js 24. (#1049)
-
Added support for
masterin thephp-versioninput. It should now set up a nightly build from the master branch ofphp-src. -
Added support to install
ioncubeandzephir_parserextensions on PHP 8.5. -
Expanded support for installing extensions using Homebrew on macOS from the
shivammathur/homebrew-extensionstap. This includespdo_firebird,sqlsrv,pdo_sqlsrv,pecl_http,swow,xhprof, and several other supported extensions. -
Improved switching PHP versions on Linux. Missing alternatives should now be registered automatically before switching versions. #1067
-
Improved support for Homebrew on macOS. It should now retry stuck
brewcommands with an inactivity watchdog. -
Improved support for adding tools. It should now correctly use the latest release download URL when a version is not specified. (#1064)
-
Improved tool setup and caching on self-hosted runners.
-
Improved support for
sqlsrvandpdo_sqlsrvon PHP 8.1 and 8.2. -
Fixed installing
pecl_httpon Windows. Switched todownloads.php.netfor fixingICUversion post install. -
Fixed cached
couchbaseinstalls on macOS using theshivammathur/cache-extensionsaction. -
Replaced
@actions/corewith local functions to reduce bundle size. -
Refactored to use ES2024+ features for Node 24.
-
Updated actions used in examples to their latest versions.
-
Updated Node.js dependencies.
Thanks @theluckystrike for the contribution 🎉
Thanks @code-kudu, @ssddanbrown, @RoundingWell, and @ntzrbtr for the sponsorship ❤️
For the complete list of changes, please refer to the Full Changelog
Follow for updates
2.36.0
Changelog
- Added support for PHP 8.5 stable release.
- name: Setup PHP 8.5 (stable)
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'- Added support for PHP 8.6.0-dev. Specifying
8.6in thephp-versioninput should now set up a nightly build from the master branch ofphp-src. (#1002)
- name: Setup PHP 8.6.0-dev
uses: shivammathur/setup-php@v2
with:
php-version: '8.6'- Added support for
pdo_ibmandibm_db2extensions.
- name: Setup PHP with pdo_ibm and ibm_db2 extensions
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
extensions: pdo_ibm, ibm_db2- Added support to install
blackfireextension on PHP 8.5.
- name: Setup PHP with blackfire extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
extensions: blackfire- Improved support to detect the required libraries when building from source for common extensions. For example installing
gnupgfrom source would install the requiredlibgpgmelibrary automatically. (#1021)
- name: Setup PHP with amqp extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
extensions: gnupg-1.5.4- Improved support for
symfony-cli. It should now correctly set up the requested version. (#1008)
- name: Setup PHP with symfony-cli
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
tools: symfony-cli:5.16.0-
Improved support for
relayextension. Also added support to install the nightly version of the extension. (#1011, #1012) -
Improved installing PHP on macOS. Also fixed installing PHP on
macos-15-intelGitHub runner. (#1029) -
Improved support for
deb822format sources files on Linux. It should now set up the sources files indeb822format on Ubuntu 24.04, Debian 13, and newer. It would automatically switch the format as well for the repositories added by the action to the new format when supported. (#1027) -
Improved support for installing
pdo_oci. (#1028) -
Fixed installing
gearmanextension for PHP 5.6 and 7.0 on Linux. -
Fixed an edge case in tools setup to fall back to the latest version. (#1024)
-
Fixed support to build extensions with uppercase names from PECL. (#1017)
-
Fixed warning on
redissetup on macOS after formula rename. (shivammathur/homebrew-extensions#5413) -
Fixed fallback link for
composersetup. (#1025) -
Updated the link for flex documentation in README. (#1020)
-
Updated Node.js dependencies.
Thanks @shyim, @tillkruss, and @nicolas-grekas for the contributions 🎉
Thanks @JetBrainsOfficial and @cachewerk for the sponsorship ❤️
For the complete list of changes, please refer to the Full Changelog
Follow for updates
2.35.5
Changelog
- Added support for macOS 26 based environments.
runs-on: macos-26
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2- Fixed resolving tools' releases to the latest one for a version prefix in tools input. (#1000)
For example, this should install the latest release of PHPUnit with10.5as the prefix.
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: phpunit:10.5.x- Improved installing
intlextension with a particular ICU versions.
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: intl-77.1- Fixed tools setup to use the new
github-tokeninput value to avoid rate limits.
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
tools: phpcs: 4
github-token: ${{ secrets.GITHUB_TOKEN }}-
Improved errors when tools fail to install. (#991)
-
Fixed warning in get function on request failure.
-
Added a fallback source for composer phar archives. (#956)
-
Added a fallback source for PPA keys. (#996)
-
Fixed
opcache.jit_buffer_sizeconfig on arm environments. (#999) -
Updated Node.js dependencies.
For the complete list of changes, please refer to the Full Changelog
Follow for updates
2.35.4
Changelog
-
Fixed updating brew core tap before installing PHP on macOS.
-
Updated actions in internal workflows.
-
Updated Node.js dependencies.
For the complete list of changes, please refer to the Full Changelog
Follow for updates
2.35.3
Changelog
-
Improved
github-tokensupport for GitHub Enterprise. (#981).For GitHub Enterprise users, the
github-tokeninput does not default to theGITHUB_TOKENsecret. Therefore, it's recommended to set thegithub-tokeninput to a Personal Access Token (PAT).
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
github-token: ${{ secrets.YOUR_PAT_TOKEN }}-
Fixed support for
relayextension for PHP 7.4 on macOS. -
Updated internal workflows to not run on forks. (#982)
-
Updated Node.js dependencies.
Thanks @jrfnl for the contributions 🎉
For the complete list of changes, please refer to the Full Changelog
Follow for updates
2.35.2
Changelog
- Fixed race condition in updating composer
auth.json. (#980)
For the complete list of changes, please refer to the Full Changelog