Prebuilt PHP Binaries
The StaticPHP project publishes ready-to-run static PHP binaries for the most common extension combinations. Nothing has to be compiled on your machine: pick a combination, a PHP minor line and a platform, download the archive, and use the binary.
TIP
This page is about consuming the published binaries. If you want your own extension set, build it yourself with First Build.
What is published
| Combination | Extensions | Platforms | Typical use |
|---|---|---|---|
minimal | 7 | Linux, macOS (x86_64, aarch64) | Small CLI tools |
common | 37 | Linux, macOS (x86_64, aarch64) | Typical web application (curl, gd, PDO, redis, zip, …) |
bulk | 56 | Linux, macOS (x86_64, aarch64) | Everything, including swoole, imagick, opentelemetry, protobuf |
gnu-bulk | 56 | Linux (x86_64, aarch64), glibc 2.17 target | The bulk set for older glibc distributions |
spc-min | 7 | Windows (x86_64) | Small CLI tools on Windows |
spc-max | 50 | Windows (x86_64) | Everything on Windows |
Every combination is published for the SAPIs cli, micro and fpm, except Windows, which has cli and micro only.
The exact extension list of a build is recorded in its metadata (build-command), so you can always check what a combination contained when it was built.
PHP 8.6
The hosted release currently publishes PHP 8.2–8.5. PHP 8.6 is supported by the builder, but is not published as a prebuilt combination yet because bulk/gnu-bulk include Swoole, which does not support PHP 8.6. Build 8.6 from source without Swoole if you need it now.
Download layout
Archives live under one directory per combination:
https://dl.static-php.dev/v3/php-bin/<combination>/<file>File names follow the revision scheme:
rev 0 php-<version>-<sapi>-<platform>.<ext>
rev N php-<version>-N-<sapi>-<platform>.<ext>| Field | Values |
|---|---|
<version> | Full PHP patch version, e.g. 8.4.28 |
<sapi> | cli, micro, fpm (no fpm on Windows) |
<platform> | linux-x86_64, linux-aarch64, macos-x86_64, macos-aarch64, win |
<ext> | tar.gz on Linux/macOS, zip on Windows |
Archive contents:
| SAPI | Linux / macOS member | Windows member |
|---|---|---|
cli | php | php.exe |
micro | micro.sfx | micro.sfx |
fpm | php-fpm | — |
Metadata
Two JSON documents describe what is published. They are rewritten on every release, while the archives themselves are immutable.
versions.json — which PHP patch each minor line currently points at:
{
"latest": { "8.3": "8.3.37", "8.4": "8.4.28" },
"version-files": { "8.3": "version_83.json", "8.4": "version_84.json" }
}version_<MM>.json — the per-platform file names, sizes and checksums (trimmed):
{
"combination": "bulk",
"php-version": "8.3.37",
"revision": 1,
"revisions": [0, 1],
"spc-ref": "v3@565e5eb",
"built-at": "2026-11-16T13:42:02Z",
"build-command": "bin/spc build --build-cli --build-micro --build-fpm \"...\" --dl-with-php=\"8.3.37\"",
"artifacts": {
"linux-aarch64": {
"revision": 1,
"spc-target": null,
"cli": {
"file": "php-8.3.37-1-cli-linux-aarch64.tar.gz",
"size": 31673079,
"sha256": "05d98942f389441d8522a350e02ad11b77fb3e57d0101cc4dd50a4dcbd12deb9"
}
}
}
}Each archive is accompanied by a <file>.sha256 sidecar in sha256sum format.
The directory also contains rolling files that are republished with the newest build: README.txt, build-manifest.json and license/.
Revisions are tracked per platform
Archives are never overwritten. A republish writes a new revision (rev N) next to the old one, and revision / revisions record that history. Because a republish is built platform by platform, a platform whose build failed stays on its previous revision — which means:
artifacts.<platform>.revisionis authoritative for that platform;- the top-level
revisionis only the newest revision of the combination and is not guaranteed to exist for every platform; - always take the file name from
artifacts.<platform>.<sapi>.fileinstead of building it from the top-levelrevision.
Verify before use
Every archive has a checksum sidecar, and the same hash is in the metadata:
base=https://dl.static-php.dev/v3/php-bin/bulk
file=php-8.4.28-1-cli-linux-x86_64.tar.gz
curl -fsSLO "$base/$file"
curl -fsSLO "$base/$file.sha256"
sha256sum -c "$file.sha256"Resolve with one request
staticphp.sh exposes a single endpoint that resolves the newest archive and redirects to it:
# download the newest bulk 8.3 CLI build for a Linux aarch64 box
curl -fL -o php "https://staticphp.sh/fetch.php?combination=bulk&version=8.3&os=linux&arch=aarch64&sapi=cli"
# ask what that redirect would be, without downloading anything
curl -fsSL "https://staticphp.sh/fetch.php?combination=bulk&version=8.3&format=json"| Parameter | Values | Default |
|---|---|---|
combination | minimal common bulk gnu-bulk spc-min spc-max | common |
version | 8.2 8.3 8.4 8.5, an exact patch (8.3.37) or latest | latest |
os | linux macos windows | linux |
arch | x86_64 aarch64 (amd64, x64 and arm64 are accepted) | x86_64 |
sapi | cli micro fpm (fpm is unix only) | cli |
format | json returns the resolution instead of redirecting | — |
With format=json the response also carries the checksum, so a download can be verified without a second request:
{
"combination": "bulk",
"version": "8.3.37",
"platform": "linux-aarch64",
"sapi": "cli",
"revision": 1,
"file": "php-8.3.37-1-cli-linux-aarch64.tar.gz",
"size": 31673079,
"sha256": "05d98942f389441d8522a350e02ad11b77fb3e57d0101cc4dd50a4dcbd12deb9",
"url": "https://dl.static-php.dev/v3/php-bin/bulk/php-8.3.37-1-cli-linux-aarch64.tar.gz"
}Errors carry a machine-readable code (invalid_combination, version_not_published, sapi_not_published, …) and an HTTP status of 400, 404 or 502.
The endpoint is a convenience layer over the metadata described above: it always resolves through artifacts.<platform>.<sapi>.file, so it cannot hand out a file name that was never published, but the published metadata stays the source of truth if you prefer not to depend on a third service.
Resolve the metadata yourself
Without the endpoint, two requests are enough:
base=https://dl.static-php.dev/v3/php-bin/bulk
minor=8.3
ver=$(curl -fsSL "$base/versions.json" | jq -r --arg m "$minor" '.latest[$m]')
mm=$(printf '%s' "$ver" | awk -F. '{print $1 $2}')
file=$(curl -fsSL "$base/version_$mm.json" |
jq -r '.artifacts["linux-aarch64"].cli.file')
curl -fLO "$base/$file"
curl -fsSL "$base/$file.sha256" | sha256sum -cHelper scripts
Two clients wrap all of the above — they detect the platform, resolve through the endpoint (falling back to the metadata when it is unreachable), verify the SHA-256 checksum and can unpack the binary.
POSIX shell
curl -fsSLO https://staticphp.sh/fetch.sh && chmod +x fetch.sh
./fetch.sh # newest common/cli build for this machine
./fetch.sh -v 8.3 -c bulk # bulk 8.3, cli
./fetch.sh -v 8.3 -c bulk -s micro -e # download micro.sfx and unpack it
./fetch.sh --direct -v 8.3 --json # resolve through the metadata only, print JSON-v, --version VERSION 8.2 | 8.3 | 8.4 | 8.5, an exact patch, or latest (default: latest)
-c, --combination NAME minimal | common | bulk | gnu-bulk | spc-min | spc-max
(default: spc-max on Windows, common elsewhere)
-s, --sapi NAME cli | micro | fpm (default: cli)
-o, --os NAME linux | macos | windows (default: autodetect)
-a, --arch NAME x86_64 | aarch64 (default: autodetect)
-d, --dir PATH download directory (default: .)
-e, --extract unpack the binary next to the archive
--json print the resolution instead of downloading
--direct skip the endpoint and read dl.static-php.dev metadataPowerShell
The PowerShell client targets Windows (its defaults are spc-max, cli), and also runs on PowerShell 7 for Linux and macOS — there you pass the unix combination explicitly or set -Os:
iwr -useb https://staticphp.sh/fetch.ps1 -OutFile fetch.ps1
.\fetch.ps1 # newest Windows build (spc-max, cli)
.\fetch.ps1 -Version 8.3 -Combination spc-max -Sapi micro -Extract
.\fetch.ps1 -Version 8.3 -Combination spc-min -Extract # the smaller Windows set
.\fetch.ps1 -Version 8.3 -Direct -Json-Version VERSION 8.2 | 8.3 | 8.4 | 8.5, an exact patch, or latest (default: latest)
-Combination NAME minimal | common | bulk | gnu-bulk | spc-min | spc-max
(default: spc-max on Windows, common elsewhere)
-Sapi NAME cli | micro | fpm (default: cli)
-Os NAME linux | macos | windows (default: autodetect)
-Arch NAME x86_64 | aarch64 (default: autodetect)
-Dir PATH download directory (default: .)
-Extract unpack the binary next to the archive
-Json print the resolution instead of downloading
-Direct skip the endpoint and read dl.static-php.dev metadataThe scripts live in static-php/shell-web together with the service itself.
Using the binaries
CLI — unpack and run:
tar -xzf php-8.4.28-1-cli-linux-x86_64.tar.gz php
./php -v
./php -mmicro — phpmicro merges the interpreter with your code, so append your .phar or .php file to micro.sfx:
tar -xzf php-8.4.28-1-micro-linux-x86_64.tar.gz micro.sfx
cat micro.sfx app.phar > app
chmod +x app
./appfpm — needs a php-fpm.conf; the binary is otherwise self-contained:
tar -xzf php-8.4.28-1-fpm-linux-x86_64.tar.gz php-fpm
./php-fpm -F -y ./php-fpm.confSee PHP SAPI Reference for the SAPI-specific details.
Caveats
- Only the newest patch of each minor line is described by the metadata. Older archives stay on the CDN, but you need their exact revision to address them.
gnu-bulktargets glibc 2.17; the archive file name still uses the plainlinux-x86_64/linux-aarch64suffix, while the metadata key carries-gnu.- Windows archives are
.zipand containphp.exe/micro.sfx. - The binaries are not code-signed; always verify the SHA-256 checksum before deploying them.
README.txt,build-manifest.jsonandlicense/describe the newest build, not a specific revision.
What's Next
- PHP SAPI Reference — How to use the CLI, micro, FPM and embed SAPIs
- First Build — Build your own combination from source
- Supported Extensions — Which extensions are available
