Automated PHP compilation for Windows using GitHub Actions, built on PHP's official php-windows-builder.
Developed by ServBay Team
- π Based on PHP official build tool (php-windows-builder)
- π¦ Support multiple PHP versions (stable/testing/development)
- π§ Extension building and management
- π― Flexible version and extension configuration
- π Thread-Safe and Non-Thread-Safe builds
- π Complete GitHub Actions automation
- β Automated testing and packaging
- π Detailed build information and SHA256 checksums
This project provides a zero-configuration way to build PHP for Windows:
- β No local environment setup needed - Everything runs on GitHub Actions
- β Official PHP build tools - Based on PHP's maintained builder
- β Extension support - Build popular extensions automatically
- β Complete testing - Runs official PHP tests
- β Automatic packaging - Creates release-ready artifacts
Fork this repository to your GitHub account.
Navigate to the Actions tab in your forked repository.
- Select Build PHP for Windows workflow
- Click Run workflow
- Fill in the parameters (see examples below)
- Click Run workflow to start
Version Type: stable
Version Number: 8.4.14
Architecture: x64
Thread Safety: nts
Build Extensions: true
Custom Extensions JSON: (leave empty)
Create GitHub Release: trueIncluded extensions: xdebug, redis, apcu, imagick, memcache, memcached, mongodb, imap
Version Type: stable
Version Number: 8.4.14
Architecture: x64
Thread Safety: nts
Build Extensions: true
Custom Extensions JSON: [{"name":"swoole","url":"https://github.com/swoole/swoole-src","ref":"5.1.5","args":"--enable-swoole","libs":"openssl nghttp2"}]
Create GitHub Release: trueVersion Type: testing
Testing Tag: php-8.5.0RC4
Architecture: x64
Thread Safety: nts
Build Extensions: true
Create GitHub Release: trueVersion Type: development
Dev Commit Hash: 1cf63a93801e02d9f75dde59b849dcfa632b9237
Dev Version: 8.6.0-dev-20251105
Architecture: x64
Thread Safety: nts
Build Extensions: false
Create GitHub Release: true| Parameter | Description | Example |
|---|---|---|
| Version Type | stable/testing/development | stable |
| Stable Version | PHP stable version | 8.4.14 |
| Testing Tag | GitHub tag name | php-8.5.0RC4 |
| Dev Commit Hash | Git commit hash | 1cf63a93... |
| Dev Version | Custom version ID | 8.6.0-dev-20251105 |
| Parameter | Description | Options |
|---|---|---|
| Architecture | CPU architecture | x64 / x86 |
| Thread Safety | Thread safety mode | nts / ts |
Recommendation: Use nts for better performance (for Nginx, IIS FastCGI)
| Parameter | Description | Default |
|---|---|---|
| Build Extensions | Build extensions | true |
| Custom Extensions JSON | Override defaults | See below |
- xdebug 3.4.0 - Debugger
- redis 6.1.0 - Redis client
- apcu 5.1.24 - APCu cache
- imagick 3.7.0 - Image processing
- memcache 8.2 - Memcache client
- memcached 3.3.0 - Memcached client
- mongodb 1.20.1 - MongoDB driver
- imap 1.0.2 - IMAP extension
[
{
"name": "extension-name",
"url": "https://github.com/owner/repo",
"ref": "tag-or-branch",
"args": "--enable-extension",
"libs": "dep1 dep2"
}
]See also:
- extensions.default.json - Default configuration
- extensions.example.json - More examples
- EXTENSIONS_GUIDE.md - Complete guide
| Parameter | Description | Default |
|---|---|---|
| Create GitHub Release | Auto-create release | true |
php-{version}-{type}-{TS/NTS}-Win-{arch}.zip- PHP buildphp-{version}-{type}-{TS/NTS}-Win-{arch}.sha256- Checksumextension-{name}-{version}-{arch}-{TS/NTS}/- Extension builds
Automatically creates release with:
- Complete PHP package with all extensions
- SHA256 checksum
- BUILD_INFO.md (build information)
Windows PowerShell:
$hash = (Get-FileHash -Path "php-*.zip" -Algorithm SHA256).Hash
$expected = (Get-Content "php-*.sha256")
if ($hash -eq $expected) {
Write-Host "β Verification passed"
} else {
Write-Host "β Verification failed"
}Linux/macOS:
sha256sum -c php-*.sha256- Extensions Guide - How to configure extensions
- PHP 8.6 README - PHP 8.6 specific information
- Version Mapping - Version compatibility
- Migration Guide - Upgrading from v1.x
- Changelog - Version history
- Contributing - How to contribute
A: This project uses GitHub Actions (official builder) - the only recommended method.
Advantages:
- β Zero setup - No local environment needed
- β Reliable - Based on officially maintained tools
- β Complete - Native extension support
- β Fast - GitHub's high-performance environment
A:
-
NTS (Non-Thread-Safe) - Recommended
- For: Nginx + PHP-FPM, IIS FastCGI
- Better performance
-
TS (Thread-Safe)
- For: Apache mod_php
- Supports multithreading
A: Specify the ref field in extension JSON:
{
"name": "xdebug",
"url": "https://github.com/xdebug/xdebug",
"ref": "3.4.0",
"args": "--enable-xdebug"
}Find extension versions on their GitHub releases/tags page.
A: Troubleshooting steps:
- Check Actions logs for specific errors
- Verify PHP version/tag is correct
- Verify extension JSON format is valid
- Check extension compatibility with PHP version
A: All PECL and third-party extensions with source code. Popular ones:
- Xdebug, Redis, Imagick, Swoole, MongoDB
- PDO drivers, GD, ZIP, OpenSSL, cURL
- More: EXTENSIONS_GUIDE.md
User Input β Prepare β Build PHP β Build Extensions β Package β Release
(Parse) (Official) (Official) (ZIP+SHA256) (GitHub)
Uses php-windows-builder:
- Automatic dependency download
- Automatic Visual Studio configuration
- Built-in test runner
- PGO optimization support
- ServBay - Modern Development Environment
- PHP Official Website
- PHP Windows Builder
- PHP SDK Binary Tools
- PHP Windows Documentation
- PECL Extensions
This project uses the same license as PHP.
Issues and Pull Requests are welcome!
Especially welcome:
- Add more popular extension configurations
- Improve documentation
- Report bugs and issues
See: CONTRIBUTING.md
This project is developed and maintained by the ServBay Team.
Special thanks to:
- PHP development team for php-windows-builder
- All contributors for their support
π‘ Tip: This project is designed for GitHub Actions - simple, fast, and reliable!