2026-07-04 07:43:21 +00:00
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
|
<html lang="zh" dir="ltr">
|
|
|
|
|
|
<head>
|
|
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
|
|
|
|
<title>从 v2 迁移 | StaticPHP</title>
|
|
|
|
|
|
<meta name="description" content="A powerful tool designed for building portable executables including PHP, extensions, and more.">
|
2026-07-16 06:25:16 +00:00
|
|
|
|
<meta name="generator" content="VitePress v2.0.0-alpha.18">
|
|
|
|
|
|
<link rel="preload stylesheet" href="/assets/style.C4OPn_QV.css" as="style">
|
2026-07-04 07:43:21 +00:00
|
|
|
|
<link rel="preload stylesheet" href="/vp-icons.css" as="style">
|
|
|
|
|
|
|
2026-07-16 06:25:16 +00:00
|
|
|
|
<script type="module" src="/assets/app.Bw02Lh2k.js"></script>
|
|
|
|
|
|
<link rel="preload" href="/assets/inter-roman-latin.Cy4MYw_J.woff2" as="font" type="font/woff2" crossorigin="">
|
|
|
|
|
|
<link rel="modulepreload" href="/assets/chunks/theme.C_odZu9O.js">
|
|
|
|
|
|
<link rel="modulepreload" href="/assets/chunks/framework.DrNIf5Lg.js">
|
|
|
|
|
|
<link rel="modulepreload" href="/assets/zh_guide_migrate-from-v2.md.Dp7VZbGT.lean.js">
|
|
|
|
|
|
<script id="check-dark-mode">(()=>{let e=localStorage.getItem(`vitepress-theme-appearance`)||`auto`,t=window.matchMedia(`(prefers-color-scheme: dark)`).matches;(!e||e===`auto`?t:e===`dark`)&&document.documentElement.classList.add(`dark`)})();</script>
|
|
|
|
|
|
<script id="check-mac-os">document.documentElement.classList.toggle(`mac`,/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
|
2026-07-04 07:43:21 +00:00
|
|
|
|
</head>
|
|
|
|
|
|
<body>
|
2026-07-16 06:25:16 +00:00
|
|
|
|
<div id="app"><div class="Layout" data-v-0cf61682><!--[--><!--]--><!--[--><span tabindex="-1" data-v-414181b2></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-414181b2>Skip to content</a><!--]--><!----><header class="VPNav" data-v-0cf61682 data-v-9f75dce3><div class="VPNavBar has-sidebar top" data-v-9f75dce3 data-v-9ca1369d><div class="wrapper" data-v-9ca1369d><div class="container" data-v-9ca1369d><div class="title" data-v-9ca1369d><div class="VPNavBarTitle has-sidebar" data-v-9ca1369d data-v-1e38c6bc><a class="title" href="/zh/" data-v-1e38c6bc><!--[--><!--]--><!--[--><img class="VPImage logo" src="/images/static-php_nobg.png" alt data-v-8426fc1a><!--]--><span data-v-1e38c6bc>StaticPHP</span><!--[--><!--]--></a></div></div><div class="content" data-v-9ca1369d><div class="content-body" data-v-9ca1369d><!--[--><!--]--><div class="VPNavBarSearch search" data-v-9ca1369d data-v-2fc7f2c6><!--[--><button type="button" class="VPNavBarSearchButton" aria-label="Search" aria-keyshortcuts="/ control+k meta+k" data-v-2fc7f2c6 data-v-baa3be99><span class="vpi-search" aria-hidden="true" data-v-baa3be99></span><span class="text" data-v-baa3be99>Search</span><span class="keys" aria-hidden="true" data-v-baa3be99><kbd class="key-cmd" data-v-baa3be99>⌘</kbd><kbd class="key-ctrl" data-v-baa3be99>Ctrl</kbd><kbd data-v-baa3be99>K</kbd></span></button><button type="button" class="VPNavBarAskAiButton" aria-label="Ask AI" aria-keyshortcuts="control+i meta+i" data-v-2fc7f2c6 data-v-4eb17e89><span class="vpi-sparkles" aria-hidden="true" data-v-4eb17e89></span></button><!----><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-9ca1369d data-v-7b3e138d><span id="main-nav-aria-label" class="visually-hidden" data-v-7b3e138d> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/zh/guide/" tabindex="0" data-v-7b3e138d data-v-6500c4c4><!--[--><span data-v-6500c4c4>构建指南</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/zh/develop/" tabindex="0" data-v-7b3e138d data-v-6500c4c4><!--[--><span data-v-6500c4c4>开发者</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/zh/contributing/" tabindex="0" data-v-7b3e138d data-v-6500c4c4><!--[--><span data-v-6500c4c4>贡献</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/zh/faq/" tabindex="0" data-v-7b3e138d data-v-6500c4c4><!--[--><span data-v-6500c4c4>FAQ</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-7b3e138d data-v-42cb505d><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-42cb505d><span class="text" data-v-42cb505d><!----><span data-v-42cb505d>v3 (alpha)</span><span class="vpi-chevron-down text-icon" data-v-42cb505d></span></span></button><div class="menu" data-v-42cb505d><div class="VPMenu" data-v-42cb505d data-v-25a6cce8><div class="items" data-v-25a6cce8><!--[--><!--[--><div class="VPMenuLink" data-v-25a6cce8 data-v-fff73daa><a class="VPLink link" href="/zh/" data-v-fff73daa><!--[--><span data-v-fff73daa>v3 (alpha)</span><!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-25a6cce8 data-v-fff73daa><a class="VPLink link" href="https://static-php.github.io/v2-docs/" data-v-fff73daa><!--[--><span data-v-fff73daa>v2</span><!--]--></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--]--></nav><div class="VPFlyout VPNavBarTranslations translations" data-v-9ca1369d data-v-c70a0580 data-v-42cb505d><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="Change language" data-v-42cb505d><span class="text" data-v-42cb505d><span class="vpi-languages option-icon" data-v-42cb505d></span><!----><span class="vpi-chevron-down text-icon" data-v-42cb505d></span></span></button><div class="menu" data-v-42cb505d><div class="VPMenu" data-v-42cb505d data-v-25a6cce8><!----><!--[--><!--[--><div class="items" data-v-c70a0580><p class="title" data-v-c70a0580>简体中文</p><!--[--><div class="V
|
2026-07-04 07:43:21 +00:00
|
|
|
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64</span></span>
|
|
|
|
|
|
<span class="line"></span>
|
2026-07-16 06:25:16 +00:00
|
|
|
|
<span class="line"><span style="--shiki-light:#62687b;--shiki-dark:#818e99;"># v3</span></span>
|
|
|
|
|
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://dl.static-php.dev/v3/spc-bin/nightly/spc-linux-x86_64</span></span></code></pre></div><h2 id="已移除的命令" tabindex="-1">已移除的命令 <a class="header-anchor" href="#已移除的命令" aria-label="Permalink to “已移除的命令”"></a></h2><table tabindex="0"><thead><tr><th>v2 命令</th><th>v3 替代方案</th><th>说明</th></tr></thead><tbody><tr><td><code>del-download</code></td><td><code>spc reset</code></td><td><code>reset</code> 支持 <code>--with-pkgroot</code> 和 <code>--with-download</code> 以进行更细粒度的控制</td></tr><tr><td><code>del-download --all</code></td><td><code>spc reset --with-download</code></td><td>删除下载缓存目录</td></tr></tbody></table><h2 id="已移除的选项" tabindex="-1">已移除的选项 <a class="header-anchor" href="#已移除的选项" aria-label="Permalink to “已移除的选项”"></a></h2><h3 id="with-added-patch-p-build-命令" tabindex="-1"><code>--with-added-patch</code> / <code>-P</code>(build 命令) <a class="header-anchor" href="#with-added-patch-p-build-命令" aria-label="Permalink to “--with-added-patch / -P(build 命令)”"></a></h3><p>该选项允许在特定构建阶段注入外部 PHP patch 脚本。<strong>v3 已完全移除此功能。</strong></p><p>目前没有直接的替代方案。如果你依赖此功能,请考虑以下方式:</p><ul><li>将你的 patch 贡献到 StaticPHP 的上游仓库。</li><li>对于项目专用的 patch,可以使用自定义 registry 并编写 Package 类。详情参见<a href="/zh/develop/extending/package-classes.html">编写 Package 类</a>。</li></ul><div class="tip custom-block"><p class="custom-block-title">未来计划</p><p>未来版本可能会提供用于轻量级 patch 的单文件 hook API。</p></div><h3 id="windows-专有-with-sdk-binary-dir-和-vs-ver" tabindex="-1">Windows 专有:<code>--with-sdk-binary-dir</code> 和 <code>--vs-ver</code> <a class="header-anchor" href="#windows-专有-with-sdk-binary-dir-和-vs-ver" aria-label="Permalink to “Windows 专有:--with-sdk-binary-dir 和 --vs-ver”"></a></h3><p>这两个选项已不再被命令行接受。在 v3 中,<code>php-sdk-binary-tools</code> 依赖已被完全移除。v3 现在通过管理自己的 <strong>MSYS2</strong> 环境来支持 Windows 上基于 autotools 的库构建。运行 <code>spc doctor --install</code> 即可自动下载并配置 MSYS2。</p><p>如需指向自定义 MSYS2 安装目录,请设置 <code>SPC_MSYS2_PATH</code> 环境变量,值为 <code>msys64</code> 目录路径(例如 <code>C:\msys64</code>)。Visual Studio 版本现在由工具链自动检测,无需手动指定版本号。</p><div class="warning custom-block"><p class="custom-block-title">从 v2 迁移</p><p>v2 依赖 <code>php-sdk-binary-tools</code>,并在每次构建时需要传入 <code>--with-sdk-binary-dir</code> 和 <code>--vs-ver</code> 参数。在 v3 中这些选项已被移除。请从所有 CI 脚本中删除这些参数,并使用 <code>spc doctor --install</code> 一次性完成 Windows 构建环境的配置。</p></div><h2 id="已重命名-已弃用的选项" tabindex="-1">已重命名 / 已弃用的选项 <a class="header-anchor" href="#已重命名-已弃用的选项" aria-label="Permalink to “已重命名 / 已弃用的选项”"></a></h2><p>以下选项已重命名。部分旧名称仍作为弃用别名被接受,但建议尽快更新脚本。</p><table tabindex="0"><thead><tr><th>v2 选项</th><th>v3 选项</th><th>状态</th></tr></thead><tbody><tr><td><code>--prefer-pre-built</code></td><td><code>--prefer-binary</code> / <code>-p</code></td><td>旧名称保留为弃用别名</td></tr><tr><td><code>--with-libs=<list></code></td><td><code>--with-packages=<list></code>
|
2026-07-04 07:43:21 +00:00
|
|
|
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> curl,gd</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build-cli</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --with-libs=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"openssl"</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -L</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -E</span></span>
|
|
|
|
|
|
<span class="line"></span>
|
2026-07-16 06:25:16 +00:00
|
|
|
|
<span class="line"><span style="--shiki-light:#62687b;--shiki-dark:#818e99;"># v3</span></span>
|
|
|
|
|
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> curl,gd</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build-cli</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --with-packages=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"openssl"</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --with-suggests</span></span></code></pre></div><h2 id="build-命令行为变化" tabindex="-1"><code>build</code> 命令行为变化 <a class="header-anchor" href="#build-命令行为变化" aria-label="Permalink to “build 命令行为变化”"></a></h2><p><code>build</code> 命令(别名:<code>build:php</code>)仍然可用。但 v3 新增了<strong>专用的单目标构建命令</strong>,无需再传入 SAPI 选择标志:</p><table tabindex="0"><thead><tr><th>v2</th><th>v3 等价命令</th></tr></thead><tbody><tr><td><code>spc build exts --build-cli</code></td><td><code>spc build:php-cli exts</code></td></tr><tr><td><code>spc build exts --build-fpm</code></td><td><code>spc build:php-fpm exts</code></td></tr><tr><td><code>spc build exts --build-cgi</code></td><td><code>spc build:php-cgi exts</code></td></tr><tr><td><code>spc build exts --build-micro</code></td><td><code>spc build:php-micro exts</code></td></tr><tr><td><code>spc build exts --build-embed</code></td><td><code>spc build:php-embed exts</code></td></tr><tr><td><code>spc build exts --build-frankenphp</code></td><td><code>spc build:frankenphp exts</code></td></tr></tbody></table><p>如果需要在一次构建中同时编译多个 SAPI,请继续使用 <code>build:php</code>(<code>--build-*</code> 标志在该命令下仍然有效)。</p><h3 id="构建命令自动下载依赖" tabindex="-1">构建命令自动下载依赖 <a class="header-anchor" href="#构建命令自动下载依赖" aria-label="Permalink to “构建命令自动下载依赖”"></a></h3><p>v3 中,所有 <code>build:*</code> 命令在构建前会自动下载缺失的依赖包,不再需要单独执行 <code>spc download</code>:</p><div class="language-bash"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#62687b;--shiki-dark:#818e99;"># v2 — 需要两步</span></span>
|
2026-07-04 07:43:21 +00:00
|
|
|
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> download</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --for-extensions=curl,gd</span></span>
|
|
|
|
|
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> curl,gd</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build-cli</span></span>
|
|
|
|
|
|
<span class="line"></span>
|
2026-07-16 06:25:16 +00:00
|
|
|
|
<span class="line"><span style="--shiki-light:#62687b;--shiki-dark:#818e99;"># v3 — 一步即可</span></span>
|
|
|
|
|
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build:php-cli</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> curl,gd</span></span></code></pre></div><p>如需跳过自动下载(例如在 CI 中源码已预先缓存),可传入 <code>--no-download</code>:</p><div class="language-bash"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build:php-cli</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> curl,gd</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --no-download</span></span></code></pre></div><h2 id="download-命令选项变化" tabindex="-1"><code>download</code> 命令选项变化 <a class="header-anchor" href="#download-命令选项变化" aria-label="Permalink to “download 命令选项变化”"></a></h2><table tabindex="0"><thead><tr><th>v2</th><th>v3</th><th>说明</th></tr></thead><tbody><tr><td><code>--prefer-pre-built</code></td><td><code>--prefer-binary</code> / <code>-p</code></td><td>弃用别名保留</td></tr><tr><td><code>--with-libs</code></td><td><code>--for-libs</code></td><td>与包过滤分开</td></tr><tr><td><em>(无等价)</em></td><td><code>--for-packages</code></td><td>统一包过滤器</td></tr><tr><td><em>(无等价)</em></td><td><code>--parallel</code> / <code>-P</code></td><td>并行下载</td></tr><tr><td><em>(无等价)</em></td><td><code>--retry</code> / <code>-R</code></td><td>失败重试</td></tr></tbody></table><h2 id="已移除的-dev-命令" tabindex="-1">已移除的 dev 命令 <a class="header-anchor" href="#已移除的-dev-命令" aria-label="Permalink to “已移除的 dev 命令”"></a></h2><p>以下开发辅助命令已被移除或合并:</p><table tabindex="0"><thead><tr><th>v2 命令</th><th>v3 替代方案</th></tr></thead><tbody><tr><td><code>dev:extensions</code> / <code>list-ext</code></td><td><code>spc dev:info <package></code></td></tr><tr><td><code>dev:ext-version</code> / <code>dev:ext-ver</code></td><td><code>spc dev:info <package></code></td></tr><tr><td><code>dev:lib-version</code> / <code>dev:lib-ver</code></td><td><code>spc dev:info <package></code></td></tr><tr><td><code>dev:php-version</code> / <code>dev:php-ver</code></td><td><code>spc dev:info php-src</code></td></tr><tr><td><code>dev:gen-ext-dep-docs</code> + <code>dev:gen-lib-dep-docs</code></td><td><code>spc dev:gen-deps-data</code></td></tr></tbody></table><h2 id="已重命名的-dev-命令" tabindex="-1">已重命名的 dev 命令 <a class="header-anchor" href="#已重命名的-dev-命令" aria-label="Permalink to “已重命名的 dev 命令”"></a></h2><table tabindex="0"><thead><tr><th>v2</th><th>v3</th><th>说明</th></tr></thead><tbody><tr><td><code>dev:sort-config</code> / <code>sort-config</code></td><td><code>dev:lint-config</code></td><td>旧别名仍可用</td></tr></tbody></table><h2 id="v3-新增命令" tabindex="-1">v3 新增命令 <a class="header-anchor" href="#v3-新增命令" aria-label="Permalink to “v3 新增命令”"></a></h2><p>以下命令为 v3 新增,v2 中没有对应命令:</p><table tabindex="0"><thead><tr><th>命令</th><th>说明</th></tr></thead><tbody><tr><td><code>spc reset</code></td><td>清理 <code>buildroot/</code> 和 <code>source/</code> 目录</td></tr><tr><td><code>spc check-update</code></td><td>检查 artifact 的最新版本</td></tr><tr><td><code>spc build:php-cli</code></td><td>构建 CLI SAPI(无需标志)</td></tr><tr><td><code>spc build:php-fpm</code></td><td>构建 PHP-FPM(无需标志)</td></tr><tr><td><code>spc build:php-cgi</code></td><td>构建 PHP CGI(无需标志)</td></tr>
|
|
|
|
|
|
<span class="line"><span style="--shiki-light:#11782a;--shiki-dark:#85E89D;">build-options</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
|
|
|
|
|
<span class="line"><span style="--shiki-light:#11782a;--shiki-dark:#85E89D;"> with-added-patch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
|
|
|
|
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> - </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">my-patch.php</span></span></code></pre></div><h3 id="libs-→-packages-两者均可用" tabindex="-1"><code>libs</code> → <code>packages</code>(两者均可用) <a class="header-anchor" href="#libs-→-packages-两者均可用" aria-label="Permalink to “libs → packages(两者均可用)”"></a></h3><p>顶层 <code>libs</code> 字段仍然有效。v3 中推荐使用 <code>packages</code>,它是 <code>libs</code> 的超集,还涵盖其他工具类包:</p><div class="language-yaml"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#62687b;--shiki-dark:#818e99;"># v2</span></span>
|
|
|
|
|
|
<span class="line"><span style="--shiki-light:#11782a;--shiki-dark:#85E89D;">libs</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nghttp2,liblz4</span></span>
|
2026-07-04 07:43:21 +00:00
|
|
|
|
<span class="line"></span>
|
2026-07-16 06:25:16 +00:00
|
|
|
|
<span class="line"><span style="--shiki-light:#62687b;--shiki-dark:#818e99;"># v3(推荐)</span></span>
|
|
|
|
|
|
<span class="line"><span style="--shiki-light:#11782a;--shiki-dark:#85E89D;">packages</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">nghttp2,liblz4</span></span></code></pre></div><h2 id="env-ini-变量重命名" tabindex="-1"><code>env.ini</code> 变量重命名 <a class="header-anchor" href="#env-ini-变量重命名" aria-label="Permalink to “env.ini 变量重命名”"></a></h2><p>如果你在 <code>config/env.ini</code> 中进行了自定义,或在 CI 中导出了环境变量,请更新以下变量名:</p><table tabindex="0"><thead><tr><th>v2 变量名</th><th>v3 变量名</th></tr></thead><tbody><tr><td><code>SPC_LINUX_DEFAULT_CC</code></td><td><code>SPC_DEFAULT_CC</code></td></tr><tr><td><code>SPC_LINUX_DEFAULT_CXX</code></td><td><code>SPC_DEFAULT_CXX</code></td></tr><tr><td><code>SPC_LINUX_DEFAULT_AR</code></td><td><code>SPC_DEFAULT_AR</code></td></tr><tr><td><code>SPC_LINUX_DEFAULT_LD</code></td><td><code>SPC_DEFAULT_LD</code></td></tr><tr><td><code>SPC_LIBC</code></td><td><code>SPC_TARGET</code></td></tr></tbody></table><p><code>SPC_TARGET</code> 使用新的格式,将架构与 libc 编码在一个字符串中,例如:</p><table tabindex="0"><thead><tr><th>v2</th><th>v3</th></tr></thead><tbody><tr><td><code>SPC_LIBC=musl</code></td><td><code>SPC_TARGET=x86_64-linux-musl</code></td></tr><tr><td><code>SPC_LIBC=gnu</code></td><td><code>SPC_TARGET=x86_64-linux-gnu.2.17</code></td></tr></tbody></table><p>v3 还新增了若干日志相关变量(<code>SPC_ENABLE_LOG_FILE</code>、<code>SPC_LOGS_DIR</code>、<code>SPC_PRESERVE_LOGS</code>)。详情参见<a href="/zh/guide/env-vars.html">环境变量</a>。</p></div></div></main><footer class="VPDocFooter" data-v-7011f0d8 data-v-e29034c6><!--[--><!--]--><!----><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e29034c6><span class="visually-hidden" id="doc-footer-aria-label" data-v-e29034c6>Pager</span><div class="pager" data-v-e29034c6><a class="VPLink link pager-link prev" href="/zh/guide/cli-reference.html" data-v-e29034c6><!--[--><span class="desc" data-v-e29034c6>Previous page</span><span class="title" data-v-e29034c6>命令行参考</span><!--]--></a></div><div class="pager" data-v-e29034c6><a class="VPLink link pager-link next" href="/zh/guide/extensions.html" data-v-e29034c6><!--[--><span class="desc" data-v-e29034c6>Next page</span><span class="title" data-v-e29034c6>支持的扩展列表</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-0cf61682 data-v-c3855bb3><div class="container" data-v-c3855bb3><p class="message" data-v-c3855bb3>Released under the MIT License.</p><p class="copyright" data-v-c3855bb3>Copyright © 2023-present crazywhalecc</p></div></footer><!--[--><!--]--></div></div>
|
|
|
|
|
|
<script>window.__VP_HASH_MAP__=JSON.parse("{\"deps-craft-yml.md\":\"BlUAUDy4\",\"en_contributing_index.md\":\"DJrK0rwl\",\"en_develop_artifact-model.md\":\"CSsy1IGq\",\"en_develop_build-lifecycle.md\":\"DAZqcB7z\",\"en_develop_craft-yml.md\":\"KSoZofRA\",\"en_develop_doctor-module.md\":\"ByvES-_A\",\"en_develop_extending_annotations.md\":\"UKL7B7B3\",\"en_develop_extending_custom-artifact.md\":\"DotD8ITd\",\"en_develop_extending_dependency-injection.md\":\"CyyHOkvH\",\"en_develop_extending_index.md\":\"B2xj8d9p\",\"en_develop_extending_lifecycle-hooks.md\":\"6uwWcfAD\",\"en_develop_extending_package-classes.md\":\"y3Xf7UZ4\",\"en_develop_index.md\":\"BITZJqcR\",\"en_develop_package-model.md\":\"CMZBu01x\",\"en_develop_php-src-changes.md\":\"Cc0fC8cE\",\"en_develop_registry.md\":\"BsjJNDQv\",\"en_develop_structure.md\":\"D8gP8oQJ\",\"en_develop_system-build-tools.md\":\"CUw5wQ4E\",\"en_faq_index.md\":\"BvIAh2aW\",\"en_guide_cli-generator.md\":\"C6SB8xhE\",\"en_guide_cli-reference.md\":\"D7EY77fp\",\"en_guide_deps-map.md\":\"DKgvqXtD\",\"en_guide_env-vars.md\":\"BgjYKJG9\",\"en_guide_extension-notes.md\":\"B3shjkUU\",\"en_guide_extensions.md\":\"ATwZq3HB\",\"en_guide_first-build.md\":\"INdBGOsG\",\"en_guide_index.md\":\"z0D1Gcrs\",\"en_guide_installation.md\":\"BV9Ks-lX\",\"en_guide_migrate-from-v2.md\":\"CUFkYufx\",\"en_guide_sapi-reference.md\":\"p2zEyiLe\",\"en_guide_troubleshooting.md\":\"DVi8H9ZX\",\"en_index.md\":\"D-9tNbNs\",\"index.md\":\"TfAAAF_x\",\"zh_contributing_index.md\":\"8SUl40-w\",\"zh_develop_artifact-model.md\":\"CrLRSeeY\",\"zh_develop_build-lifecycle.md\":\"DLh_YUAK\",\"zh_develop_craft-yml.md\":\"uyL3P4FG\",\"zh_develop_doctor-module.md\":\"B-KVjOyS\",\"zh_develop_extending_annotations.md\":\"Dcz6J_X-\",\"zh_develop_extending_custom-artifact.md\":\"BoYCxDEr\",\"zh_develop_extending_dependency-injection.md\":\"BKeBJfDY\",\"zh_develop_extending_index.md\":\"B7wWMbKy\",\"zh_develop_extending_lifecycle-hooks.md\":\"CG51Rugr\",\"zh_develop_extending_package-classes.md\":\"DBU2hT9_\",\"zh_develop_index.md\":\"CrUwzvi2\",\"zh_develop_package-model.md\":\"DDw9ZCCd\",\"zh_develop_php-src-changes.md\":\"artDuYna\",\"zh_develop_registry.md\":\"ChqnXzVM\",\"zh_develop_structure.md\":\"BivWsi6C\",\"zh_develop_system-build-tools.md\":\"BLdfbezU\",\"zh_faq_index.md\":\"ypwV8ySx\",\"zh_guide_cli-generator.md\":\"BuKsNlwB\",\"zh_guide_cli-reference.md\":\"LVzdkmu2\",\"zh_guide_deps-map.md\":\"9-QWHshB\",\"zh_guide_env-vars.md\":\"D2oUaqNR\",\"zh_guide_extension-notes.md\":\"D9lGXhKW\",\"zh_guide_extensions.md\":\"CNtRfejb\",\"zh_guide_first-build.md\":\"DSwF9CHy\",\"zh_guide_index.md\":\"DR1hBcxc\",\"zh_guide_installation.md\":\"CWZRSBwL\",\"zh_guide_migrate-from-v2.md\":\"Dp7VZbGT\",\"zh_guide_sapi-reference.md\":\"TjYI_FdR\",\"zh_guide_troubleshooting.md\":\"CJ6N_2fk\",\"zh_index.md\":\"BXvgifjq\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"StaticPHP\",\"description\":\"A powerful tool designed for building portable executables including PHP, extensions, and more.\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"logo\":\"/images/static-php_nobg.png\",\"nav\":[],\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/crazywhalecc/static-php-cli\"}],\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2023-present crazywhalecc\"},\"externalLinkIcon\":true,\"search\":{\"provider\":\"algolia\",\"options\":{\"appId\":\"IHJHUB1SF1\",\"apiKey\":\"8266d31cc2ffbd0e059f1c6e5bdaf8fc\",\"indexName\":\"static-php docs\",\"askAi\":{\"assistantId\":\"b72369b2-60a5-461d-902c-5c18d8c05902\",\"agentStudio\":true,\"sidePanel\":true}}}},\"locales\":{\"en\":{\"label\":\"English\",\"lang\":\"en\",\"themeConfig\":{\"nav\":[{\"text\":\"Guide\",\"link\":\"/en/guide/\"},{\"text\":\"Develop\",\"link\":\"/en/develop/\"},{\"text\":\"Contributing\",\"link\":\"/en/contributing/\"},{\"text\":\"FAQ\",\"link\":\"/en/faq/\"},{\"text\":\"v3 (alpha)\",\"items\":[{\"text\":\"v3 (alpha)\",\"link\":\"/en/\
|
2026-07-04 07:43:21 +00:00
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
|
</html>
|