Compare commits

...

38 Commits

Author SHA1 Message Date
Marc
95bb4cb018 Merge branch 'main' into rename 2025-11-30 16:09:18 +01:00
Marc
6b3b841c0e Fix cross-device warning in rename function (#978) 2025-11-30 16:08:09 +01:00
crazywhalecc
e316971764 Fix cross-device warning in rename function 2025-11-29 14:08:34 +08:00
Marc
d55278714f we need to change source_path for shared build (#977) 2025-11-26 16:10:27 +07:00
Jerry Ma
cb7eca9049 Bump version from 2.7.8 to 2.7.9 2025-11-26 17:08:49 +08:00
henderkes
5b8c9e6f09 we need to change source_path for shared build 2025-11-26 09:37:21 +01:00
Jerry Ma
5d1043334d Add extension maxminddb support for macOS and Linux (#975) 2025-11-26 15:32:26 +08:00
crazywhalecc
1bbf83872f Change phpmicro base link 2025-11-26 13:28:15 +08:00
crazywhalecc
fadb1ce6c9 Rename static-php-cli to StaticPHP 2025-11-26 13:24:38 +08:00
crazywhalecc
58bf51e9c9 Next version yeah 2025-11-26 12:55:14 +08:00
crazywhalecc
b60ea8e3d6 Add maxminddb extension and libmaxminddb 2025-11-26 12:54:52 +08:00
Marc
f24cbcf909 fix silly mistake in trader config.m4 (#973) 2025-11-25 08:12:50 +01:00
henderkes
76a07c32ba fix silly mistake in trader config.m4 2025-11-24 14:24:12 +01:00
Marc
e0c69086dc don't download musl if zig isn't building for musl (#972) 2025-11-22 10:07:35 +01:00
henderkes
5606b70c1c don't download musl if zig isn't building for musl 2025-11-22 09:04:17 +01:00
Marc
28ae4242a6 add extra libs for curl (psl, krb5, unistring, idn2) (#968) 2025-11-21 15:05:40 +01:00
Jerry Ma
f14df1925c Store original source directory before modification 2025-11-21 22:03:41 +08:00
Marc
e9ad3c0011 Merge branch 'main' into feat/libcurl-extra 2025-11-21 09:21:22 +01:00
Marc
e2ad31e858 Support PHP 8.5 release (#971) 2025-11-21 09:16:13 +01:00
Marc
af614cd7ce Fix indentation in PhpSource.php 2025-11-21 08:51:30 +01:00
Marc
e21b0ec89d Apply suggestion from @henderkes 2025-11-20 18:21:39 +01:00
Marc
3069b51c09 we have 8.5! 2025-11-20 18:19:41 +01:00
henderkes
1662ac4cf8 framework! 2025-11-19 15:20:05 +01:00
henderkes
1e09017549 frameworks? 2025-11-19 14:49:37 +01:00
henderkes
84e9f13688 framework? 2025-11-19 14:48:10 +01:00
henderkes
2b0a0bdad9 fix cs 2025-11-19 13:54:45 +01:00
henderkes
e8d1970f55 secure_getenv not available on macos 2025-11-19 13:54:17 +01:00
henderkes
6861e9c2c7 append ld_library_path for musl toolchain 2025-11-19 11:59:09 +01:00
henderkes
376b8e7569 remove psl 2025-11-19 10:48:24 +01:00
Marc Henderkes
875e1d05cd libedit instead of readline 2025-11-18 17:50:49 +01:00
Marc Henderkes
9382161b6f Revert "add gsasl"
This reverts commit a1b8d201ae.
2025-11-18 17:49:10 +01:00
Marc Henderkes
a1b8d201ae add gsasl 2025-11-18 17:47:26 +01:00
Marc Henderkes
1fed8f2802 add required libs to krb5 2025-11-18 17:22:27 +01:00
Marc Henderkes
ecea6c12cd libs for macos too 2025-11-18 14:35:58 +01:00
Marc Henderkes
81dce02431 use lgpl 2025-11-18 14:06:15 +01:00
Marc Henderkes
a33ca44ca9 test curl 2025-11-18 11:28:25 +01:00
Marc
aee733b51f Merge branch 'main' into feat/libcurl-extra 2025-11-18 11:22:05 +01:00
Marc Henderkes
54ceca8680 add extra libs for curl (psl, krb5, unistring, idn2) 2025-11-18 11:17:12 +01:00
31 changed files with 561 additions and 189 deletions

View File

@@ -1,24 +1,24 @@
# static-php-cli # StaticPHP
[![English readme](https://img.shields.io/badge/README-English%20%F0%9F%87%AC%F0%9F%87%A7-moccasin?style=flat-square)](README.md)
[![Chinese readme](https://img.shields.io/badge/README-%E4%B8%AD%E6%96%87%20%F0%9F%87%A8%F0%9F%87%B3-moccasin?style=flat-square)](README-zh.md) [![Chinese readme](https://img.shields.io/badge/README-%E4%B8%AD%E6%96%87%20%F0%9F%87%A8%F0%9F%87%B3-moccasin?style=flat-square)](README-zh.md)
[![English readme](https://img.shields.io/badge/README-English%20%F0%9F%87%AC%F0%9F%87%A7-moccasin?style=flat-square)](README.md)
[![Releases](https://img.shields.io/packagist/v/crazywhalecc/static-php-cli?include_prereleases&label=Release&style=flat-square)](https://github.com/crazywhalecc/static-php-cli/releases) [![Releases](https://img.shields.io/packagist/v/crazywhalecc/static-php-cli?include_prereleases&label=Release&style=flat-square)](https://github.com/crazywhalecc/static-php-cli/releases)
[![CI](https://img.shields.io/github/actions/workflow/status/crazywhalecc/static-php-cli/tests.yml?branch=main&label=Build%20Test&style=flat-square)](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml) [![CI](https://img.shields.io/github/actions/workflow/status/crazywhalecc/static-php-cli/tests.yml?branch=main&label=Build%20Test&style=flat-square)](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
[![License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE) [![License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
**static-php-cli** 是一个用于构建静态、独立 PHP 运行时的强大工具,支持众多流行扩展。 **StaticPHP**(原名 **static-php-cli**是一个用于构建静态、独立 PHP 运行时的强大工具,支持众多流行扩展。
## 特性 ## 特性
- :elephant: **支持多 PHP 版本** - 支持 PHP 8.1, 8.2, 8.3, 8.4, 8.5 - :elephant: **支持多 PHP 版本** - 支持 PHP 8.1, 8.2, 8.3, 8.4, 8.5
- :handbag: **单文件 PHP 可执行文件** - 构建零依赖的独立 PHP - :handbag: **单文件 PHP 可执行文件** - 构建零依赖的独立 PHP
- :hamburger: **phpmicro 集成** - 构建 **[phpmicro](https://github.com/dixyes/phpmicro)** 自解压可执行文件(将 PHP 二进制文件和源代码合并为一个文件) - :hamburger: **phpmicro 集成** - 构建 **[phpmicro](https://github.com/static-php/phpmicro)** 自解压可执行文件(将 PHP 二进制文件和源代码合并为一个文件)
- :pill: **智能环境检查器** - 自动构建环境检查器,具备自动修复功能 - :pill: **智能环境检查器** - 自动构建环境检查器,具备自动修复功能
- :zap: **跨平台支持** - 支持 Linux、macOS、FreeBSD 和 Windows - :zap: **跨平台支持** - 支持 Linux、macOS、FreeBSD 和 Windows
- :wrench: **可配置补丁** - 可自定义的源代码补丁系统 - :wrench: **可配置补丁** - 可自定义的源代码补丁系统
- :books: **智能依赖管理** - 自动处理构建依赖 - :books: **智能依赖管理** - 自动处理构建依赖
- 📦 **自包含工具** - 提供使用 [box](https://github.com/box-project/box) 构建的 `spc` 可执行文件 - 📦 **自包含工具** - 提供使用 [box](https://github.com/box-project/box) 构建的 `spc` 可执行文件
- :fire: **广泛的扩展支持** - 支持 75+ 流行 [扩展](https://static-php.dev/zh/guide/extensions.html) - :fire: **广泛的扩展支持** - 支持 100+ 流行 [扩展](https://static-php.dev/zh/guide/extensions.html)
- :floppy_disk: **UPX 压缩** - 减小二进制文件大小 30-50%(仅 Linux/Windows - :floppy_disk: **UPX 压缩** - 减小二进制文件大小 30-50%(仅 Linux/Windows
**单文件独立 php-cli** **单文件独立 php-cli**
@@ -33,6 +33,8 @@
### 1. 下载 spc 二进制文件 ### 1. 下载 spc 二进制文件
`spc` 二进制文件是 StaticPHP 项目的 CLI 工具,打包为单个可执行文件。
```bash ```bash
# Linux x86_64 # Linux x86_64
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64 curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
@@ -107,7 +109,7 @@ buildroot/bin/php-fpm -v
以下是几个具有不同扩展组合的预编译静态 PHP 二进制文件, 以下是几个具有不同扩展组合的预编译静态 PHP 二进制文件,
您可以根据需要直接下载。 您可以根据需要直接下载。
| 组合名称 | 扩展数量 | 系统 | 备注 | | 组合名称 | 扩展数量 | 系统 | 备注 |
|----------------------------------------------------------------------|----------------------------------------------------------------------------|--------------|--------------------| |----------------------------------------------------------------------|----------------------------------------------------------------------------|--------------|--------------------|
| [common](https://dl.static-php.dev/static-php-cli/common/) | [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) | Linux, macOS | 二进制文件大小约为 7.5MB | | [common](https://dl.static-php.dev/static-php-cli/common/) | [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) | Linux, macOS | 二进制文件大小约为 7.5MB |
| [bulk](https://dl.static-php.dev/static-php-cli/bulk/) | [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) | Linux, macOS | 二进制文件大小约为 25MB | | [bulk](https://dl.static-php.dev/static-php-cli/bulk/) | [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) | Linux, macOS | 二进制文件大小约为 25MB |

View File

@@ -1,4 +1,4 @@
# static-php-cli # StaticPHP
[![Chinese readme](https://img.shields.io/badge/README-%E4%B8%AD%E6%96%87%20%F0%9F%87%A8%F0%9F%87%B3-moccasin?style=flat-square)](README-zh.md) [![Chinese readme](https://img.shields.io/badge/README-%E4%B8%AD%E6%96%87%20%F0%9F%87%A8%F0%9F%87%B3-moccasin?style=flat-square)](README-zh.md)
[![English readme](https://img.shields.io/badge/README-English%20%F0%9F%87%AC%F0%9F%87%A7-moccasin?style=flat-square)](README.md) [![English readme](https://img.shields.io/badge/README-English%20%F0%9F%87%AC%F0%9F%87%A7-moccasin?style=flat-square)](README.md)
@@ -6,14 +6,13 @@
[![CI](https://img.shields.io/github/actions/workflow/status/crazywhalecc/static-php-cli/tests.yml?branch=main&label=Build%20Test&style=flat-square)](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml) [![CI](https://img.shields.io/github/actions/workflow/status/crazywhalecc/static-php-cli/tests.yml?branch=main&label=Build%20Test&style=flat-square)](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
[![License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE) [![License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://github.com/crazywhalecc/static-php-cli/blob/main/LICENSE)
**static-php-cli** is a powerful tool designed for building static, standalone PHP runtime **StaticPHP** (formerly **static-php-cli**) is a powerful tool designed for building static, standalone PHP runtime with popular extensions.
with popular extensions.
## Features ## Features
- :elephant: Support multiple PHP versions - PHP 8.1, 8.2, 8.3, 8.4, 8.5 - :elephant: Support multiple PHP versions - PHP 8.1, 8.2, 8.3, 8.4, 8.5
- :handbag: Build single-file PHP executable with zero dependencies - :handbag: Build single-file PHP executable with zero dependencies
- :hamburger:Build **[phpmicro](https://github.com/dixyes/phpmicro)** self-extracting executables (combines PHP binary and source code into one file) - :hamburger:Build **[phpmicro](https://github.com/static-php/phpmicro)** self-extracting executables (combines PHP binary and source code into one file)
- :pill: Automatic build environment checker with auto-fix capabilities - :pill: Automatic build environment checker with auto-fix capabilities
- :zap: `Linux`, `macOS`, `FreeBSD`, `Windows` support - :zap: `Linux`, `macOS`, `FreeBSD`, `Windows` support
- :wrench: Configurable source code patching - :wrench: Configurable source code patching
@@ -34,6 +33,8 @@ with popular extensions.
### 1. Download spc binary ### 1. Download spc binary
`spc` binary is StaticPHP CLI tool packaged as a single executable file.
```bash ```bash
# For Linux x86_64 # For Linux x86_64
curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64 curl -fsSL -o spc https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64
@@ -53,7 +54,7 @@ For macOS and Linux, add execute permission first:
chmod +x ./spc chmod +x ./spc
``` ```
### 2. Build Static PHP ### 2. Build standalone PHP binaries
First, create a `craft.yml` file and specify which extensions you want to include from [extension list](https://static-php.dev/en/guide/extensions.html) or [command generator](https://static-php.dev/en/guide/cli-generator.html): First, create a `craft.yml` file and specify which extensions you want to include from [extension list](https://static-php.dev/en/guide/extensions.html) or [command generator](https://static-php.dev/en/guide/cli-generator.html):
@@ -79,7 +80,7 @@ Run command:
./spc craft --debug ./spc craft --debug
``` ```
### 3. Static PHP usage ### 3. Using the built binaries
Now you can copy binaries built by static-php-cli to another machine and run with no dependencies: Now you can copy binaries built by static-php-cli to another machine and run with no dependencies:
@@ -105,7 +106,7 @@ see <https://static-php.dev> .
If you don't want to build or want to test first, you can download example pre-compiled artifact from [Actions](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-bulk.yml), or from self-hosted server. If you don't want to build or want to test first, you can download example pre-compiled artifact from [Actions](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-bulk.yml), or from self-hosted server.
Below are several precompiled static-php binaries with different extension combinations, Below are several precompiled statically built php binaries with different extension combinations,
which can be downloaded directly according to your needs. which can be downloaded directly according to your needs.
| Combination | Extension Count | OS | Comment | | Combination | Extension Count | OS | Comment |

176
composer.lock generated
View File

@@ -416,16 +416,16 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v7.3.4", "version": "v7.3.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "2b9c5fafbac0399a20a2e82429e2bd735dcfb7db" "reference": "c28ad91448f86c5f6d9d2c70f0cf68bf135f252a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/2b9c5fafbac0399a20a2e82429e2bd735dcfb7db", "url": "https://api.github.com/repos/symfony/console/zipball/c28ad91448f86c5f6d9d2c70f0cf68bf135f252a",
"reference": "2b9c5fafbac0399a20a2e82429e2bd735dcfb7db", "reference": "c28ad91448f86c5f6d9d2c70f0cf68bf135f252a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -490,7 +490,7 @@
"terminal" "terminal"
], ],
"support": { "support": {
"source": "https://github.com/symfony/console/tree/v7.3.4" "source": "https://github.com/symfony/console/tree/v7.3.6"
}, },
"funding": [ "funding": [
{ {
@@ -510,7 +510,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-09-22T15:31:00+00:00" "time": "2025-11-04T01:21:42+00:00"
}, },
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
@@ -981,16 +981,16 @@
}, },
{ {
"name": "symfony/service-contracts", "name": "symfony/service-contracts",
"version": "v3.6.0", "version": "v3.6.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/service-contracts.git", "url": "https://github.com/symfony/service-contracts.git",
"reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4" "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4", "url": "https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43",
"reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4", "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1044,7 +1044,7 @@
"standards" "standards"
], ],
"support": { "support": {
"source": "https://github.com/symfony/service-contracts/tree/v3.6.0" "source": "https://github.com/symfony/service-contracts/tree/v3.6.1"
}, },
"funding": [ "funding": [
{ {
@@ -1055,12 +1055,16 @@
"url": "https://github.com/fabpot", "url": "https://github.com/fabpot",
"type": "github" "type": "github"
}, },
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{ {
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-04-25T09:37:31+00:00" "time": "2025-07-15T11:30:57+00:00"
}, },
{ {
"name": "symfony/string", "name": "symfony/string",
@@ -1154,16 +1158,16 @@
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v7.3.3", "version": "v7.3.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "d4f4a66866fe2451f61296924767280ab5732d9d" "reference": "90208e2fc6f68f613eae7ca25a2458a931b1bacc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/d4f4a66866fe2451f61296924767280ab5732d9d", "url": "https://api.github.com/repos/symfony/yaml/zipball/90208e2fc6f68f613eae7ca25a2458a931b1bacc",
"reference": "d4f4a66866fe2451f61296924767280ab5732d9d", "reference": "90208e2fc6f68f613eae7ca25a2458a931b1bacc",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1206,7 +1210,7 @@
"description": "Loads and dumps YAML files", "description": "Loads and dumps YAML files",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/yaml/tree/v7.3.3" "source": "https://github.com/symfony/yaml/tree/v7.3.5"
}, },
"funding": [ "funding": [
{ {
@@ -1226,20 +1230,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-08-27T11:34:33+00:00" "time": "2025-09-27T09:00:46+00:00"
}, },
{ {
"name": "zhamao/logger", "name": "zhamao/logger",
"version": "1.1.3", "version": "1.1.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zhamao-robot/zhamao-logger.git", "url": "https://github.com/zhamao-robot/zhamao-logger.git",
"reference": "2551b3e1dbbb1db81794d5c3a666c66804a9dca9" "reference": "b28c0c26d59d58f153c764f224c21c5901213e25"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zhamao-robot/zhamao-logger/zipball/2551b3e1dbbb1db81794d5c3a666c66804a9dca9", "url": "https://api.github.com/repos/zhamao-robot/zhamao-logger/zipball/b28c0c26d59d58f153c764f224c21c5901213e25",
"reference": "2551b3e1dbbb1db81794d5c3a666c66804a9dca9", "reference": "b28c0c26d59d58f153c764f224c21c5901213e25",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1293,9 +1297,9 @@
"description": "Another Console Logger for CLI Applications", "description": "Another Console Logger for CLI Applications",
"support": { "support": {
"issues": "https://github.com/zhamao-robot/zhamao-logger/issues", "issues": "https://github.com/zhamao-robot/zhamao-logger/issues",
"source": "https://github.com/zhamao-robot/zhamao-logger/tree/1.1.3" "source": "https://github.com/zhamao-robot/zhamao-logger/tree/1.1.4"
}, },
"time": "2025-08-02T13:44:27+00:00" "time": "2025-11-08T15:38:01+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [
@@ -2860,16 +2864,16 @@
}, },
{ {
"name": "friendsofphp/php-cs-fixer", "name": "friendsofphp/php-cs-fixer",
"version": "v3.89.0", "version": "v3.89.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "4dd6768cb7558440d27d18f54909eee417317ce9" "reference": "7569658f91e475ec93b99bd5964b059ad1336dcf"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/4dd6768cb7558440d27d18f54909eee417317ce9", "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/7569658f91e475ec93b99bd5964b059ad1336dcf",
"reference": "4dd6768cb7558440d27d18f54909eee417317ce9", "reference": "7569658f91e475ec93b99bd5964b059ad1336dcf",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2905,7 +2909,7 @@
"justinrainbow/json-schema": "^6.5", "justinrainbow/json-schema": "^6.5",
"keradus/cli-executor": "^2.2", "keradus/cli-executor": "^2.2",
"mikey179/vfsstream": "^1.6.12", "mikey179/vfsstream": "^1.6.12",
"php-coveralls/php-coveralls": "^2.8", "php-coveralls/php-coveralls": "^2.9",
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6",
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6",
"phpunit/phpunit": "^9.6.25 || ^10.5.53 || ^11.5.34", "phpunit/phpunit": "^9.6.25 || ^10.5.53 || ^11.5.34",
@@ -2951,7 +2955,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.89.0" "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.89.2"
}, },
"funding": [ "funding": [
{ {
@@ -2959,20 +2963,20 @@
"type": "github" "type": "github"
} }
], ],
"time": "2025-10-18T19:30:16+00:00" "time": "2025-11-06T21:12:50+00:00"
}, },
{ {
"name": "humbug/box", "name": "humbug/box",
"version": "4.6.8", "version": "4.6.10",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/box-project/box.git", "url": "https://github.com/box-project/box.git",
"reference": "05d205d99ddb72f3729658a0115db02cfc08912e" "reference": "6dc6a1314d63e9d75c8195c996e1081e68514c36"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/box-project/box/zipball/05d205d99ddb72f3729658a0115db02cfc08912e", "url": "https://api.github.com/repos/box-project/box/zipball/6dc6a1314d63e9d75c8195c996e1081e68514c36",
"reference": "05d205d99ddb72f3729658a0115db02cfc08912e", "reference": "6dc6a1314d63e9d75c8195c996e1081e68514c36",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -3001,7 +3005,7 @@
"symfony/process": "^6.4.0 || ^7.0.0", "symfony/process": "^6.4.0 || ^7.0.0",
"symfony/var-dumper": "^6.4.0 || ^7.0.0", "symfony/var-dumper": "^6.4.0 || ^7.0.0",
"thecodingmachine/safe": "^2.5 || ^3.0", "thecodingmachine/safe": "^2.5 || ^3.0",
"webmozart/assert": "^1.11" "webmozart/assert": "^1.12"
}, },
"conflict": { "conflict": {
"marc-mabe/php-enum": "<4.4" "marc-mabe/php-enum": "<4.4"
@@ -3071,9 +3075,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/box-project/box/issues", "issues": "https://github.com/box-project/box/issues",
"source": "https://github.com/box-project/box/tree/4.6.8" "source": "https://github.com/box-project/box/tree/4.6.10"
}, },
"time": "2025-10-13T17:13:17+00:00" "time": "2025-10-31T18:38:02+00:00"
}, },
{ {
"name": "humbug/php-scoper", "name": "humbug/php-scoper",
@@ -3208,16 +3212,16 @@
}, },
{ {
"name": "justinrainbow/json-schema", "name": "justinrainbow/json-schema",
"version": "6.6.0", "version": "6.6.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/jsonrainbow/json-schema.git", "url": "https://github.com/jsonrainbow/json-schema.git",
"reference": "68ba7677532803cc0c5900dd5a4d730537f2b2f3" "reference": "fd8e5c6b1badb998844ad34ce0abcd71a0aeb396"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/68ba7677532803cc0c5900dd5a4d730537f2b2f3", "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/fd8e5c6b1badb998844ad34ce0abcd71a0aeb396",
"reference": "68ba7677532803cc0c5900dd5a4d730537f2b2f3", "reference": "fd8e5c6b1badb998844ad34ce0abcd71a0aeb396",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -3277,9 +3281,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/jsonrainbow/json-schema/issues", "issues": "https://github.com/jsonrainbow/json-schema/issues",
"source": "https://github.com/jsonrainbow/json-schema/tree/6.6.0" "source": "https://github.com/jsonrainbow/json-schema/tree/6.6.1"
}, },
"time": "2025-10-10T11:34:09+00:00" "time": "2025-11-07T18:30:29+00:00"
}, },
{ {
"name": "kelunik/certificate", "name": "kelunik/certificate",
@@ -3700,16 +3704,16 @@
}, },
{ {
"name": "nikic/php-parser", "name": "nikic/php-parser",
"version": "v5.6.1", "version": "v5.6.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nikic/PHP-Parser.git", "url": "https://github.com/nikic/PHP-Parser.git",
"reference": "f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2" "reference": "3a454ca033b9e06b63282ce19562e892747449bb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2", "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/3a454ca033b9e06b63282ce19562e892747449bb",
"reference": "f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2", "reference": "3a454ca033b9e06b63282ce19562e892747449bb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -3752,9 +3756,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/nikic/PHP-Parser/issues", "issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v5.6.1" "source": "https://github.com/nikic/PHP-Parser/tree/v5.6.2"
}, },
"time": "2025-08-13T20:13:15+00:00" "time": "2025-10-21T19:32:17+00:00"
}, },
{ {
"name": "phar-io/composer-distributor", "name": "phar-io/composer-distributor",
@@ -6776,16 +6780,16 @@
}, },
{ {
"name": "symfony/filesystem", "name": "symfony/filesystem",
"version": "v7.3.2", "version": "v7.3.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/filesystem.git", "url": "https://github.com/symfony/filesystem.git",
"reference": "edcbb768a186b5c3f25d0643159a787d3e63b7fd" "reference": "e9bcfd7837928ab656276fe00464092cc9e1826a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/edcbb768a186b5c3f25d0643159a787d3e63b7fd", "url": "https://api.github.com/repos/symfony/filesystem/zipball/e9bcfd7837928ab656276fe00464092cc9e1826a",
"reference": "edcbb768a186b5c3f25d0643159a787d3e63b7fd", "reference": "e9bcfd7837928ab656276fe00464092cc9e1826a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -6822,7 +6826,7 @@
"description": "Provides basic utilities for the filesystem", "description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/filesystem/tree/v7.3.2" "source": "https://github.com/symfony/filesystem/tree/v7.3.6"
}, },
"funding": [ "funding": [
{ {
@@ -6842,20 +6846,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-07-07T08:17:47+00:00" "time": "2025-11-05T09:52:27+00:00"
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
"version": "v7.3.2", "version": "v7.3.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/finder.git", "url": "https://github.com/symfony/finder.git",
"reference": "2a6614966ba1074fa93dae0bc804227422df4dfe" "reference": "9f696d2f1e340484b4683f7853b273abff94421f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/2a6614966ba1074fa93dae0bc804227422df4dfe", "url": "https://api.github.com/repos/symfony/finder/zipball/9f696d2f1e340484b4683f7853b273abff94421f",
"reference": "2a6614966ba1074fa93dae0bc804227422df4dfe", "reference": "9f696d2f1e340484b4683f7853b273abff94421f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -6890,7 +6894,7 @@
"description": "Finds files and directories via an intuitive fluent interface", "description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/finder/tree/v7.3.2" "source": "https://github.com/symfony/finder/tree/v7.3.5"
}, },
"funding": [ "funding": [
{ {
@@ -6910,7 +6914,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-07-15T13:41:35+00:00" "time": "2025-10-15T18:45:57+00:00"
}, },
{ {
"name": "symfony/options-resolver", "name": "symfony/options-resolver",
@@ -7211,16 +7215,16 @@
}, },
{ {
"name": "symfony/var-dumper", "name": "symfony/var-dumper",
"version": "v7.3.4", "version": "v7.3.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/var-dumper.git", "url": "https://github.com/symfony/var-dumper.git",
"reference": "b8abe7daf2730d07dfd4b2ee1cecbf0dd2fbdabb" "reference": "476c4ae17f43a9a36650c69879dcf5b1e6ae724d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/b8abe7daf2730d07dfd4b2ee1cecbf0dd2fbdabb", "url": "https://api.github.com/repos/symfony/var-dumper/zipball/476c4ae17f43a9a36650c69879dcf5b1e6ae724d",
"reference": "b8abe7daf2730d07dfd4b2ee1cecbf0dd2fbdabb", "reference": "476c4ae17f43a9a36650c69879dcf5b1e6ae724d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -7274,7 +7278,7 @@
"dump" "dump"
], ],
"support": { "support": {
"source": "https://github.com/symfony/var-dumper/tree/v7.3.4" "source": "https://github.com/symfony/var-dumper/tree/v7.3.5"
}, },
"funding": [ "funding": [
{ {
@@ -7294,7 +7298,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-09-11T10:12:26+00:00" "time": "2025-09-27T09:00:46+00:00"
}, },
{ {
"name": "thecodingmachine/safe", "name": "thecodingmachine/safe",
@@ -7437,16 +7441,16 @@
}, },
{ {
"name": "theseer/tokenizer", "name": "theseer/tokenizer",
"version": "1.2.3", "version": "1.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/theseer/tokenizer.git", "url": "https://github.com/theseer/tokenizer.git",
"reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" "reference": "d74205c497bfbca49f34d4bc4c19c17e22db4ebb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "url": "https://api.github.com/repos/theseer/tokenizer/zipball/d74205c497bfbca49f34d4bc4c19c17e22db4ebb",
"reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "reference": "d74205c497bfbca49f34d4bc4c19c17e22db4ebb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -7475,7 +7479,7 @@
"description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
"support": { "support": {
"issues": "https://github.com/theseer/tokenizer/issues", "issues": "https://github.com/theseer/tokenizer/issues",
"source": "https://github.com/theseer/tokenizer/tree/1.2.3" "source": "https://github.com/theseer/tokenizer/tree/1.3.0"
}, },
"funding": [ "funding": [
{ {
@@ -7483,32 +7487,32 @@
"type": "github" "type": "github"
} }
], ],
"time": "2024-03-03T12:36:25+00:00" "time": "2025-11-13T13:44:09+00:00"
}, },
{ {
"name": "webmozart/assert", "name": "webmozart/assert",
"version": "1.11.0", "version": "1.12.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/webmozarts/assert.git", "url": "https://github.com/webmozarts/assert.git",
"reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" "reference": "9be6926d8b485f55b9229203f962b51ed377ba68"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", "url": "https://api.github.com/repos/webmozarts/assert/zipball/9be6926d8b485f55b9229203f962b51ed377ba68",
"reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", "reference": "9be6926d8b485f55b9229203f962b51ed377ba68",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-ctype": "*", "ext-ctype": "*",
"ext-date": "*",
"ext-filter": "*",
"php": "^7.2 || ^8.0" "php": "^7.2 || ^8.0"
}, },
"conflict": { "suggest": {
"phpstan/phpstan": "<0.12.20", "ext-intl": "",
"vimeo/psalm": "<4.6.1 || 4.6.2" "ext-simplexml": "",
}, "ext-spl": ""
"require-dev": {
"phpunit/phpunit": "^8.5.13"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@@ -7539,9 +7543,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/webmozarts/assert/issues", "issues": "https://github.com/webmozarts/assert/issues",
"source": "https://github.com/webmozarts/assert/tree/1.11.0" "source": "https://github.com/webmozarts/assert/tree/1.12.1"
}, },
"time": "2022-06-03T18:03:27+00:00" "time": "2025-10-29T15:56:20+00:00"
} }
], ],
"aliases": [], "aliases": [],

View File

@@ -358,6 +358,18 @@
"liblz4" "liblz4"
] ]
}, },
"maxminddb": {
"support": {
"BSD": "wip",
"Windows": "wip"
},
"type": "external",
"source": "ext-maxminddb",
"arg-type": "with",
"lib-depends": [
"libmaxminddb"
]
},
"mbregex": { "mbregex": {
"type": "builtin", "type": "builtin",
"arg-type": "custom", "arg-type": "custom",

View File

@@ -104,7 +104,9 @@
"ngtcp2", "ngtcp2",
"zstd", "zstd",
"libcares", "libcares",
"ldap" "ldap",
"idn2",
"krb5"
], ],
"lib-suggests-windows": [ "lib-suggests-windows": [
"brotli", "brotli",
@@ -234,6 +236,24 @@
"unicode" "unicode"
] ]
}, },
"idn2": {
"source": "libidn2",
"pkg-configs": [
"libidn2"
],
"headers": [
"idn2.h"
],
"lib-suggests-unix": [
"libiconv",
"gettext",
"libunistring"
],
"lib-depends-macos": [
"libiconv",
"gettext"
]
},
"imagemagick": { "imagemagick": {
"source": "imagemagick", "source": "imagemagick",
"cpp-library": true, "cpp-library": true,
@@ -281,6 +301,26 @@
"jbig_ar.h" "jbig_ar.h"
] ]
}, },
"krb5": {
"source": "krb5",
"pkg-configs": [
"krb5-gssapi"
],
"headers": [
"krb5.h",
"gssapi/gssapi.h"
],
"lib-depends": [
"openssl"
],
"lib-suggests": [
"ldap",
"libedit"
],
"frameworks": [
"Kerberos"
]
},
"ldap": { "ldap": {
"source": "ldap", "source": "ldap",
"pkg-configs": [ "pkg-configs": [
@@ -466,6 +506,16 @@
"liblz4.a" "liblz4.a"
] ]
}, },
"libmaxminddb": {
"source": "libmaxminddb",
"static-libs-unix": [
"libmaxminddb.a"
],
"headers": [
"maxminddb.h",
"maxminddb_config.h"
]
},
"libmemcached": { "libmemcached": {
"source": "libmemcached", "source": "libmemcached",
"cpp-library": true, "cpp-library": true,
@@ -568,6 +618,16 @@
"zstd" "zstd"
] ]
}, },
"libunistring": {
"source": "libunistring",
"static-libs-unix": [
"libunistring.a"
],
"headers": [
"unistr.h",
"unistring/"
]
},
"liburing": { "liburing": {
"source": "liburing", "source": "liburing",
"pkg-configs": [ "pkg-configs": [
@@ -974,24 +1034,5 @@
"zstd.h", "zstd.h",
"zstd_errors.h" "zstd_errors.h"
] ]
},
"liburing": {
"source": "liburing",
"pkg-configs": [
"liburing",
"liburing-ffi"
],
"static-libs-linux": [
"liburing.a",
"liburing-ffi.a"
],
"headers-linux": [
"liburing/",
"liburing.h"
]
},
"frankenphp": {
"source": "frankenphp",
"type": "target"
} }
} }

View File

@@ -184,6 +184,15 @@
] ]
} }
}, },
"ext-maxminddb": {
"type": "url",
"url": "https://pecl.php.net/get/maxminddb",
"filename": "ext-maxminddb.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-memcache": { "ext-memcache": {
"type": "url", "type": "url",
"url": "https://pecl.php.net/get/memcache", "url": "https://pecl.php.net/get/memcache",
@@ -305,7 +314,6 @@
"type": "ghtar", "type": "ghtar",
"repo": "php/frankenphp", "repo": "php/frankenphp",
"prefer-stable": true, "prefer-stable": true,
"provide-pre-built": false,
"license": { "license": {
"type": "file", "type": "file",
"path": "LICENSE" "path": "LICENSE"
@@ -373,16 +381,6 @@
"path": "LICENSE" "path": "LICENSE"
} }
}, },
"frankenphp": {
"type": "ghtar",
"repo": "php/frankenphp",
"prefer-stable": true,
"provide-pre-build": false,
"license": {
"type": "file",
"path": "LICENSE"
}
},
"icu-static-win": { "icu-static-win": {
"type": "url", "type": "url",
"url": "https://dl.static-php.dev/static-php-cli/deps/icu-static-windows-x64/icu-static-windows-x64.zip", "url": "https://dl.static-php.dev/static-php-cli/deps/icu-static-windows-x64/icu-static-windows-x64.zip",
@@ -441,6 +439,16 @@
"path": "COPYING" "path": "COPYING"
} }
}, },
"krb5": {
"type": "ghtagtar",
"repo": "krb5/krb5",
"match": "krb5.+-final",
"prefer-stable": true,
"license": {
"type": "file",
"path": "NOTICE"
}
},
"ldap": { "ldap": {
"type": "filelist", "type": "filelist",
"url": "https://www.openldap.org/software/download/OpenLDAP/openldap-release/", "url": "https://www.openldap.org/software/download/OpenLDAP/openldap-release/",
@@ -599,6 +607,15 @@
"path": "source/COPYING" "path": "source/COPYING"
} }
}, },
"libidn2": {
"type": "filelist",
"url": "https://ftp.gnu.org/gnu/libidn/",
"regex": "/href=\"(?<file>libidn2-(?<version>[^\"]+)\\.tar\\.gz)\"/",
"license": {
"type": "file",
"path": "COPYING.LESSERv3"
}
},
"libjpeg": { "libjpeg": {
"type": "ghtar", "type": "ghtar",
"repo": "libjpeg-turbo/libjpeg-turbo", "repo": "libjpeg-turbo/libjpeg-turbo",
@@ -633,6 +650,16 @@
"path": "LICENSE" "path": "LICENSE"
} }
}, },
"libmaxminddb": {
"type": "ghrel",
"repo": "maxmind/libmaxminddb",
"match": "libmaxminddb-.+\\.tar\\.gz",
"prefer-stable": true,
"license": {
"type": "file",
"path": "LICENSE"
}
},
"libmemcached": { "libmemcached": {
"type": "ghtagtar", "type": "ghtagtar",
"repo": "awesomized/libmemcached", "repo": "awesomized/libmemcached",
@@ -700,6 +727,16 @@
"path": "LICENSE.md" "path": "LICENSE.md"
} }
}, },
"libunistring": {
"type": "filelist",
"url": "https://ftp.gnu.org/gnu/libunistring/",
"regex": "/href=\"(?<file>libunistring-(?<version>[^\"]+)\\.tar\\.gz)\"/",
"provide-pre-built": true,
"license": {
"type": "file",
"path": "COPYING.LIB"
}
},
"liburing": { "liburing": {
"type": "ghtar", "type": "ghtar",
"repo": "axboe/liburing", "repo": "axboe/liburing",
@@ -713,6 +750,7 @@
"type": "git", "type": "git",
"url": "https://github.com/static-php/libuuid.git", "url": "https://github.com/static-php/libuuid.git",
"rev": "master", "rev": "master",
"provide-pre-built": true,
"license": { "license": {
"type": "file", "type": "file",
"path": "COPYING" "path": "COPYING"

View File

@@ -4,7 +4,7 @@ import sidebarZh from "./sidebar.zh";
// https://vitepress.dev/reference/site-config // https://vitepress.dev/reference/site-config
export default { export default {
title: "Static PHP", title: "StaticPHP",
description: "Build single static PHP binary, with PHP project together, with popular extensions included.", description: "Build single static PHP binary, with PHP project together, with popular extensions included.",
locales: { locales: {
en: { en: {

View File

@@ -1,6 +1,6 @@
# Guide # Guide
Static php cli is a tool used to build statically compiled PHP binaries, StaticPHP is a tool used to build statically compiled PHP binaries,
currently supporting Linux and macOS systems. currently supporting Linux and macOS systems.
In the guide section, you will learn how to use static php cli to build standalone PHP programs. In the guide section, you will learn how to use static php cli to build standalone PHP programs.
@@ -14,12 +14,14 @@ In the guide section, you will learn how to use static php cli to build standalo
The following is the architecture support situation, where :gear: represents support for GitHub Action build, The following is the architecture support situation, where :gear: represents support for GitHub Action build,
:computer: represents support for local manual build, and empty represents temporarily not supported. :computer: represents support for local manual build, and empty represents temporarily not supported.
| | x86_64 | aarch64 | | | x86_64 | aarch64 |
|---------|-------------------|-------------------| |---------|------------------------|------------------------|
| macOS | :gear: :computer: | :gear: :computer: | | macOS | :gear: :computer: | :gear: :computer: |
| Linux | :gear: :computer: | :gear: :computer: | | Linux | :gear: :computer: | :gear: :computer: |
| Windows | :gear: :computer: | | | Windows | :gear: :computer: | |
| FreeBSD | :computer: | :computer: | | FreeBSD | :computer: (:warning:) | :computer: (:warning:) |
> Due to lack of users and testing, FreeBSD is no longer supported in latest StaticPHP project.
Current supported PHP versions for compilation: Current supported PHP versions for compilation:
@@ -29,17 +31,17 @@ Current supported PHP versions for compilation:
> >
> :x: Not supported > :x: Not supported
| PHP Version | Status | Comment | | PHP Version | Status | Comment |
|-------------|--------------------|-------------------------------------------------------------------------------------------------------------------------| |-------------|--------------------|--------------------------------------------------------------------------------------------|
| 7.2 | :x: | | | 7.2 | :x: | |
| 7.3 | :x: | phpmicro and many extensions do not support 7.3, 7.4 versions | | 7.3 | :x: | phpmicro and many extensions do not support 7.3, 7.4 versions |
| 7.4 | :x: | phpmicro and many extensions do not support 7.3, 7.4 versions | | 7.4 | :x: | phpmicro and many extensions do not support 7.3, 7.4 versions |
| 8.0 | :warning: | PHP official has stopped maintaining 8.0, we no longer handle 8.0 related backport support | | 8.0 | :warning: | PHP official has stopped maintaining 8.0, we no longer handle 8.0 related backport support |
| 8.1 | :warning: | PHP official only provides security updates for 8.1, we no longer handle 8.1 related backport support after 8.5 release | | 8.1 | :warning: | PHP official only provides security updates for 8.1 |
| 8.2 | :heavy_check_mark: | | | 8.2 | :heavy_check_mark: | |
| 8.3 | :heavy_check_mark: | | | 8.3 | :heavy_check_mark: | |
| 8.4 | :heavy_check_mark: | | | 8.4 | :heavy_check_mark: | |
| 8.5 (beta) | :warning: | PHP 8.5 is currently in beta stage | | 8.5 | :heavy_check_mark: | |
> This table shows the support status of static-php-cli for building corresponding versions, not the PHP official support status for that version. > This table shows the support status of static-php-cli for building corresponding versions, not the PHP official support status for that version.

View File

@@ -3,7 +3,7 @@
layout: home layout: home
hero: hero:
name: "Static PHP" name: "StaticPHP"
tagline: "Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included." tagline: "Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included."
image: image:
src: /images/static-php_nobg.png src: /images/static-php_nobg.png
@@ -14,9 +14,9 @@ hero:
link: ./guide/ link: ./guide/
features: features:
- title: Static CLI Binary - title: Static PHP Binary
details: You can easily compile a standalone php binary for general use. Including CLI, FPM sapi. details: You can easily compile a standalone php binary for general use. Including CLI, FPM sapi.
- title: Micro Self-Extracted Executable - title: PHP micro Self-Extracted Executable
details: You can compile a self-extracted executable and build with your php source code. details: You can compile a self-extracted executable and build with your php source code.
- title: Dependency Management - title: Dependency Management
details: static-php-cli comes with dependency management and supports installation of different types of PHP extensions. details: static-php-cli comes with dependency management and supports installation of different types of PHP extensions.

View File

@@ -3,7 +3,7 @@
layout: home layout: home
hero: hero:
name: "Static PHP" name: "StaticPHP"
tagline: "Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included." tagline: "Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included."
image: image:
src: /images/static-php_nobg.png src: /images/static-php_nobg.png

View File

@@ -12,12 +12,14 @@ static-php-cli 是一个用于构建静态编译的 PHP 二进制的工具,目
下面是架构支持情况,:gear: 代表支持 GitHub Action 构建,:computer: 代表支持本地构建,空 代表暂不支持。 下面是架构支持情况,:gear: 代表支持 GitHub Action 构建,:computer: 代表支持本地构建,空 代表暂不支持。
| | x86_64 | aarch64 | | | x86_64 | aarch64 |
|---------|-------------------|-------------------| |---------|------------------------|------------------------|
| macOS | :gear: :computer: | :gear: :computer: | | macOS | :gear: :computer: | :gear: :computer: |
| Linux | :gear: :computer: | :gear: :computer: | | Linux | :gear: :computer: | :gear: :computer: |
| Windows | :gear: :computer: | | | Windows | :gear: :computer: | |
| FreeBSD | :computer: | :computer: | | FreeBSD | :computer: (:warning:) | :computer: (:warning:) |
> 由于缺乏用户和测试FreeBSD 在最新的 StaticPHP 项目中不再受支持。
当前支持编译的 PHP 版本: 当前支持编译的 PHP 版本:
@@ -27,17 +29,17 @@ static-php-cli 是一个用于构建静态编译的 PHP 二进制的工具,目
> >
> :x: 不支持 > :x: 不支持
| PHP Version | Status | Comment | | PHP Version | Status | Comment |
|-------------|--------------------|---------------------------------------------------------| |-------------|--------------------|----------------------------------------------|
| 7.2 | :x: | | | 7.2 | :x: | |
| 7.3 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 | | 7.3 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
| 7.4 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 | | 7.4 | :x: | phpmicro 和许多扩展不支持 7.3、7.4 版本 |
| 8.0 | :warning: | PHP 官方已停止 8.0 的维护,我们不再处理 8.0 相关的 backport 支持 | | 8.0 | :warning: | PHP 官方已停止 8.0 的维护,我们不再处理 8.0 相关的 backport 支持 |
| 8.1 | :warning: | PHP 官方仅对 8.1 提供安全更新,在 8.5 发布后我们不再处理 8.1 相关的 backport 支持 | | 8.1 | :warning: | PHP 官方仅对 8.1 提供安全更新 |
| 8.2 | :heavy_check_mark: | | | 8.2 | :heavy_check_mark: | |
| 8.3 | :heavy_check_mark: | | | 8.3 | :heavy_check_mark: | |
| 8.4 | :heavy_check_mark: | | | 8.4 | :heavy_check_mark: | |
| 8.5 (beta) | :warning: | PHP 8.5 目前处于 beta 阶段 | | 8.5 | :heavy_check_mark: | |
> 这个表格的支持状态是 static-php-cli 对构建对应版本的支持情况,不是 PHP 官方对该版本的支持情况。 > 这个表格的支持状态是 static-php-cli 对构建对应版本的支持情况,不是 PHP 官方对该版本的支持情况。

View File

@@ -34,7 +34,7 @@ use Symfony\Component\Console\Application;
*/ */
final class ConsoleApplication extends Application final class ConsoleApplication extends Application
{ {
public const string VERSION = '2.7.7'; public const string VERSION = '2.7.9';
public function __construct() public function __construct()
{ {

View File

@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('maxminddb')]
class maxminddb extends Extension
{
public function patchBeforeBuildconf(): bool
{
if (!is_dir(SOURCE_PATH . '/php-src/ext/maxminddb')) {
$original = $this->source_dir;
FileSystem::copyDir($original . '/ext', SOURCE_PATH . '/php-src/ext/maxminddb');
$this->source_dir = SOURCE_PATH . '/php-src/ext/maxminddb';
return true;
}
$this->source_dir = SOURCE_PATH . '/php-src/ext/maxminddb';
return false;
}
}

View File

@@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('trader')]
class trader extends Extension
{
public function patchBeforeBuildconf(): bool
{
FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/trader/config.m4', 'PHP_TA', 'PHP_TRADER');
return true;
}
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
class idn2 extends LinuxLibraryBase
{
use \SPC\builder\unix\library\idn2;
public const NAME = 'idn2';
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
class krb5 extends LinuxLibraryBase
{
use \SPC\builder\unix\library\krb5;
public const NAME = 'krb5';
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
class libmaxminddb extends LinuxLibraryBase
{
use \SPC\builder\unix\library\libmaxminddb;
public const NAME = 'libmaxminddb';
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
class libunistring extends LinuxLibraryBase
{
use \SPC\builder\unix\library\libunistring;
public const NAME = 'libunistring';
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
class idn2 extends MacOSLibraryBase
{
use \SPC\builder\unix\library\idn2;
public const NAME = 'idn2';
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
class krb5 extends MacOSLibraryBase
{
use \SPC\builder\unix\library\krb5;
public const NAME = 'krb5';
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
class libmaxminddb extends MacOSLibraryBase
{
use \SPC\builder\unix\library\libmaxminddb;
public const NAME = 'libmaxminddb';
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
class libunistring extends MacOSLibraryBase
{
use \SPC\builder\unix\library\libunistring;
public const NAME = 'libunistring';
}

View File

@@ -23,6 +23,8 @@ trait curl
->optionalLib('zstd', ...cmake_boolean_args('CURL_ZSTD')) ->optionalLib('zstd', ...cmake_boolean_args('CURL_ZSTD'))
->optionalLib('idn2', ...cmake_boolean_args('USE_LIBIDN2')) ->optionalLib('idn2', ...cmake_boolean_args('USE_LIBIDN2'))
->optionalLib('psl', ...cmake_boolean_args('CURL_USE_LIBPSL')) ->optionalLib('psl', ...cmake_boolean_args('CURL_USE_LIBPSL'))
->optionalLib('krb5', ...cmake_boolean_args('CURL_USE_GSSAPI'))
->optionalLib('idn2', ...cmake_boolean_args('CURL_USE_IDN2'))
->optionalLib('libcares', '-DENABLE_ARES=ON') ->optionalLib('libcares', '-DENABLE_ARES=ON')
->addConfigureArgs( ->addConfigureArgs(
'-DBUILD_CURL_EXE=OFF', '-DBUILD_CURL_EXE=OFF',

View File

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\util\executor\UnixAutoconfExecutor;
trait idn2
{
protected function build(): void
{
UnixAutoconfExecutor::create($this)
->configure(
'--disable-nls',
'--disable-doc',
'--enable-year2038',
'--disable-rpath'
)
->optionalLib('libiconv', "--with-libiconv-prefix={$this->getBuildRootPath()}")
->optionalLib('libunistring', "--with-libunistring-prefix={$this->getBuildRootPath()}")
->optionalLib('gettext', "--with-libnintl-prefix={$this->getBuildRootPath()}")
->make();
$this->patchPkgconfPrefix(['libidn2.pc']);
$this->patchLaDependencyPrefix();
}
}

View File

@@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\util\executor\UnixAutoconfExecutor;
use SPC\util\SPCConfigUtil;
trait krb5
{
protected function build(): void
{
$origin_source_dir = $this->source_dir;
$this->source_dir .= '/src';
shell()->cd($this->source_dir)->exec('autoreconf -if');
$libs = array_map(fn ($x) => $x->getName(), $this->getDependencies(true));
$spc = new SPCConfigUtil($this->builder, ['no_php' => true, 'libs_only_deps' => true]);
$config = $spc->config(libraries: $libs, include_suggest_lib: $this->builder->getOption('with-suggested-libs', false));
$extraEnv = [
'CFLAGS' => '-fcommon',
'LIBS' => $config['libs'],
];
if (getenv('SPC_LD_LIBRARY_PATH') && getenv('SPC_LIBRARY_PATH')) {
$extraEnv = [...$extraEnv, ...[
'LD_LIBRARY_PATH' => getenv('SPC_LD_LIBRARY_PATH'),
'LIBRARY_PATH' => getenv('SPC_LIBRARY_PATH'),
]];
}
$args = [
'--disable-nls',
'--disable-rpath',
'--without-system-verto',
];
if (PHP_OS_FAMILY === 'Darwin') {
$extraEnv['LDFLAGS'] = '-framework Kerberos';
$args[] = 'ac_cv_func_secure_getenv=no';
}
UnixAutoconfExecutor::create($this)
->appendEnv($extraEnv)
->optionalLib('ldap', '--with-ldap', '--without-ldap')
->optionalLib('libedit', '--with-libedit', '--without-libedit')
->configure(...$args)
->make();
$this->patchPkgconfPrefix([
'krb5-gssapi.pc',
'krb5.pc',
'kadm-server.pc',
'kadm-client.pc',
'kdb.pc',
'mit-krb5-gssapi.pc',
'mit-krb5.pc',
'gssrpc.pc',
]);
$this->source_dir = $origin_source_dir;
}
}

View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\util\executor\UnixCMakeExecutor;
trait libmaxminddb
{
protected function build(): void
{
UnixCMakeExecutor::create($this)
->addConfigureArgs(
'-DBUILD_TESTING=OFF',
'-DMAXMINDDB_BUILD_BINARIES=OFF',
)
->build();
}
}

View File

@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\util\executor\UnixAutoconfExecutor;
trait libunistring
{
protected function build(): void
{
UnixAutoconfExecutor::create($this)
->configure('--disable-nls')
->make();
$this->patchLaDependencyPrefix();
}
}

View File

@@ -22,7 +22,7 @@ class LinuxMuslCheck
public static function optionalCheck(): bool public static function optionalCheck(): bool
{ {
return getenv('SPC_TOOLCHAIN') === MuslToolchain::class || return getenv('SPC_TOOLCHAIN') === MuslToolchain::class ||
(getenv('SPC_TOOLCHAIN') === ZigToolchain::class && !SystemUtil::isMuslDist()); (getenv('SPC_TOOLCHAIN') === ZigToolchain::class && !SystemUtil::isMuslDist() && !str_contains((string) getenv('SPC_TARGET'), 'gnu'));
} }
/** @noinspection PhpUnused */ /** @noinspection PhpUnused */

View File

@@ -660,11 +660,19 @@ class FileSystem
$source = self::convertPath($source); $source = self::convertPath($source);
$dest = self::convertPath($dest); $dest = self::convertPath($dest);
// Try rename first (fast, atomic) // Check if source and dest are on the same device to avoid cross-device rename errors
if (@rename($source, $dest)) { $source_stat = @stat($source);
return; $dest_parent = dirname($dest);
$dest_stat = @stat($dest_parent);
// Only use rename if on same device
if ($source_stat !== false && $dest_stat !== false && $source_stat['dev'] === $dest_stat['dev']) {
if (@rename($source, $dest)) {
return;
}
} }
// Fall back to copy + delete for cross-device moves or if rename failed
if (is_dir($source)) { if (is_dir($source)) {
self::copyDir($source, $dest); self::copyDir($source, $dest);
self::removeDir($source); self::removeDir($source);

View File

@@ -15,9 +15,7 @@ class PhpSource extends CustomSourceBase
public function fetch(bool $force = false, ?array $config = null, int $lock_as = SPC_DOWNLOAD_SOURCE): void public function fetch(bool $force = false, ?array $config = null, int $lock_as = SPC_DOWNLOAD_SOURCE): void
{ {
$major = defined('SPC_BUILD_PHP_VERSION') ? SPC_BUILD_PHP_VERSION : '8.4'; $major = defined('SPC_BUILD_PHP_VERSION') ? SPC_BUILD_PHP_VERSION : '8.4';
if ($major === '8.5') { if ($major === 'git') {
Downloader::downloadSource('php-src', ['type' => 'url', 'url' => 'https://downloads.php.net/~daniels/php-8.5.0RC5.tar.xz'], $force);
} elseif ($major === 'git') {
Downloader::downloadSource('php-src', ['type' => 'git', 'url' => 'https://github.com/php/php-src.git', 'rev' => 'master'], $force); Downloader::downloadSource('php-src', ['type' => 'git', 'url' => 'https://github.com/php/php-src.git', 'rev' => 'master'], $force);
} else { } else {
Downloader::downloadSource('php-src', $this->getLatestPHPInfo($major), $force); Downloader::downloadSource('php-src', $this->getLatestPHPInfo($major), $force);

View File

@@ -13,11 +13,11 @@ declare(strict_types=1);
// test php version (8.1 ~ 8.4 available, multiple for matrix) // test php version (8.1 ~ 8.4 available, multiple for matrix)
$test_php_version = [ $test_php_version = [
// '8.1', '8.1',
// '8.2', '8.2',
// '8.3', '8.3',
'8.4', '8.4',
// '8.5', '8.5',
// 'git', // 'git',
]; ];
@@ -31,11 +31,11 @@ $test_os = [
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
'ubuntu-24.04-arm', // bin/spc for arm64 'ubuntu-24.04-arm', // bin/spc for arm64
// 'windows-2022', // .\bin\spc.ps1 // 'windows-2022', // .\bin\spc.ps1
'windows-2025', // 'windows-2025',
]; ];
// whether enable thread safe // whether enable thread safe
$zts = true; $zts = false;
$no_strip = false; $no_strip = false;
@@ -50,19 +50,19 @@ $prefer_pre_built = false;
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
$extensions = match (PHP_OS_FAMILY) { $extensions = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'rdkafka', 'Linux', 'Darwin' => 'maxminddb',
'Windows' => 'bcmath', 'Windows' => 'bcmath',
}; };
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`). // If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
$shared_extensions = match (PHP_OS_FAMILY) { $shared_extensions = match (PHP_OS_FAMILY) {
'Linux' => 'snmp', 'Linux' => '',
'Darwin' => 'snmp', 'Darwin' => '',
'Windows' => '', 'Windows' => '',
}; };
// If you want to test lib-suggests for all extensions and libraries, set it to true. // If you want to test lib-suggests for all extensions and libraries, set it to true.
$with_suggested_libs = true; $with_suggested_libs = false;
// If you want to test extra libs for extensions, add them below (comma separated, example `libwebp,libavif`). Unnecessary, when $with_suggested_libs is true. // If you want to test extra libs for extensions, add them below (comma separated, example `libwebp,libavif`). Unnecessary, when $with_suggested_libs is true.
$with_libs = match (PHP_OS_FAMILY) { $with_libs = match (PHP_OS_FAMILY) {
@@ -74,7 +74,7 @@ $with_libs = match (PHP_OS_FAMILY) {
// You can use `common`, `bulk`, `minimal` or `none`. // You can use `common`, `bulk`, `minimal` or `none`.
// note: combination is only available for *nix platform. Windows must use `none` combination // note: combination is only available for *nix platform. Windows must use `none` combination
$base_combination = match (PHP_OS_FAMILY) { $base_combination = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'none', 'Linux', 'Darwin' => 'minimal',
'Windows' => 'none', 'Windows' => 'none',
}; };