GitHub Actions shivammathur/setup-php "Could not find PHP version"
setup-php could not provision the requested PHP. The php-version does not exist or is unsupported on the runner OS, or an extension/tool download failed transiently while building the environment.
What this error means
The setup-php step fails resolving the version or installing an extension, and later php/composer steps fail with "command not found". Re-runs succeed when the cause was a transient download.
Actions log
Error: PHP version 8.9 is not supported
# or
Failed to download extension from PECL (transient network error)Common causes
Unsupported or non-existent php-version
A version like 8.9 that has not shipped, or one not supported on the selected runner OS, cannot be resolved by setup-php.
Transient extension/tool fetch failure
Extensions and tools are downloaded during setup. A brief PECL or package-source outage fails the install even with a valid version.
How to fix it
Request a supported version
.github/workflows/ci.yml
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, intlRetry transient downloads
- Pin php-version to a released, supported version for your runner OS.
- Re-run when the failure is an extension/tool download error rather than an unsupported-version error.
- Trim the extensions list to only what the build needs.
How to prevent it
- Pin php-version to a supported release.
- Retry transient extension-download failures.
- Keep the extensions list minimal.
Related guides
GitHub Actions actions/setup-go "Could not find a version that satisfied"Fix actions/setup-go failing to resolve a Go version - a too-specific or non-existent go-version, a missing g…
GitHub Actions actions/setup-dotnet "Could not find dotnet SDK"Fix actions/setup-dotnet failing to install a .NET SDK - a version not in the release index, a global.json pi…
GitHub Actions ruby/setup-ruby bundler-cache Fails to Restore GemsFix ruby/setup-ruby with bundler-cache: true failing - a missing Gemfile.lock, an uncommitted lockfile, or bu…