Quick Start
Get PHP set up in your GitHub Actions workflow in minutes.
PHP Versions
Support for PHP 5.3 through 8.6 including nightly builds.
Extensions
Install PHP extensions from PECL, packages, or git repositories.
Tools
Set up 50+ PHP tools globally including PHPUnit, PHPStan, and Composer.
What is setup-php?
setup-php is a GitHub Action that provides a cross-platform interface to configure PHP environments in your CI/CD workflows. It supports Ubuntu, Windows, and macOS — both GitHub-hosted and self-hosted runners.
Key capabilities
Cross-platform
Works on Ubuntu, Windows, and macOS runners. Handles differences automatically.
PHP 5.3 to 8.6
Set up any PHP version from 5.3 to the latest nightly build of 8.6.
Extension management
Add, remove, or disable PHP extensions. Supports PECL, packages, and source builds.
Coverage drivers
Configure Xdebug or PCOV for code coverage, or disable coverage to speed up tests.
50+ tools
Install PHPUnit, PHPStan, Psalm, php-cs-fixer, Rector, and many more globally.
Composer integration
Authenticates with GitHub, Private Packagist, and custom package registries.
Platform support
| Platform | GitHub-hosted | Self-hosted |
|---|---|---|
| Ubuntu 22.04 / 24.04 | ✓ | ✓ |
| Windows Server 2022 / 2025 | ✓ | ✓ |
| macOS 14 / 15 / 26 | ✓ | ✓ |
| Debian 11 / 12 / 13 | — | ✓ |
Get started
Choose your PHP version
Set
php-version to any version from 5.3 to 8.6, or use latest for the newest stable release.See the quickstart guide
A complete working workflow example to get you started in under 5 minutes.