Skip to content

Releases: shivammathur/setup-php

2.40.0

Choose a tag to compare

@shivammathur shivammathur released this 08 Oct 07:50
2.40.0
eb7c497

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 verbose environment variable. Set it to true or v to show command output, or vv or vvv to also enable tracing. Also, deprecated the verbose and more-verbose tags 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-version file containing 8.x can 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_cache environment 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

setup-php reddit setup-php twitter setup-php status

2.40.0-beta

2.40.0-beta Pre-release
Pre-release

Choose a tag to compare

@shivammathur shivammathur released this 29 Sep 02:24
bc12f5c

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-beta to 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@v2 if 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

setup-php reddit setup-php twitter setup-php status

2.37.2

Choose a tag to compare

@shivammathur shivammathur released this 08 Jun 15:44
f3e473d

Changelog

  • Fixed macOS setup by marking shivammathur/php and shivammathur/extensions as 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

setup-php reddit setup-php twitter setup-php status

2.37.1

Choose a tag to compare

@shivammathur shivammathur released this 14 May 06:17
7c071df

Changelog

Security Updates

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.

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 phalcon on Windows.

  • Fixed restoring tools when using cached using previous runs.

  • Improved enabling gearman extension on Linux.

  • Fixed fallback when installing PhpManager and VcRedist modules 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

setup-php reddit setup-php twitter setup-php status

2.37.0

Choose a tag to compare

@shivammathur shivammathur released this 15 Mar 16:11
2.37.0
accd612

Changelog

  • Updated the action to use Node.js 24. (#1049)

  • Added support for master in the php-version input. It should now set up a nightly build from the master branch of php-src.

  • Added support to install ioncube and zephir_parser extensions on PHP 8.5.

  • Expanded support for installing extensions using Homebrew on macOS from the shivammathur/homebrew-extensions tap. This includes pdo_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 brew commands 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 sqlsrv and pdo_sqlsrv on PHP 8.1 and 8.2.

  • Fixed installing pecl_http on Windows. Switched to downloads.php.net for fixing ICU version post install.

  • Fixed cached couchbase installs on macOS using the shivammathur/cache-extensions action.

  • Replaced @actions/core with 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

setup-php reddit setup-php twitter setup-php status

2.36.0

Choose a tag to compare

@shivammathur shivammathur released this 26 Nov 11:30
2.36.0
44454db

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.6 in the php-version input should now set up a nightly build from the master branch of php-src. (#1002)
- name: Setup PHP 8.6.0-dev
  uses: shivammathur/setup-php@v2
  with:
    php-version: '8.6'
  • Added support for pdo_ibm and ibm_db2 extensions.
- 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 blackfire extension 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 gnupg from source would install the required libgpgme library 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 relay extension. 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-intel GitHub runner. (#1029)

  • Improved support for deb822 format sources files on Linux. It should now set up the sources files in deb822 format 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 gearman extension 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 redis setup on macOS after formula rename. (shivammathur/homebrew-extensions#5413)

  • Fixed fallback link for composer setup. (#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

setup-php reddit setup-php twitter setup-php status

2.35.5

Choose a tag to compare

@shivammathur shivammathur released this 18 Sep 17:22
bf6b4fb

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 with 10.5 as the prefix.
- name: Setup PHP
  uses: shivammathur/setup-php@v2
  with:
    php-version: '8.1'
    tools: phpunit:10.5.x
  • Improved installing intl extension 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-token input 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_size config on arm environments. (#999)

  • Updated Node.js dependencies.

For the complete list of changes, please refer to the Full Changelog

Follow for updates

setup-php reddit setup-php twitter setup-php status

2.35.4

Choose a tag to compare

@shivammathur shivammathur released this 25 Aug 09:18
ec406be

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

setup-php reddit setup-php twitter setup-php status

2.35.3

Choose a tag to compare

@shivammathur shivammathur released this 10 Aug 07:47
2052987

Changelog

  • Improved github-token support for GitHub Enterprise. (#981).

    For GitHub Enterprise users, the github-token input does not default to the GITHUB_TOKEN secret. Therefore, it's recommended to set the github-token input 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 relay extension 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

setup-php reddit setup-php twitter setup-php status

2.35.2

Choose a tag to compare

@shivammathur shivammathur released this 29 Jul 13:41
ccf2c62

Changelog

  • Fixed race condition in updating composer auth.json. (#980)

For the complete list of changes, please refer to the Full Changelog

Follow for updates

setup-php reddit setup-php twitter setup-php status