Files
static-php-cli/zh/guide/migrate-from-v2.html

45 lines
46 KiB
HTML
Raw Normal View History

<!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.">
<meta name="generator" content="VitePress v2.0.0-alpha.12">
<link rel="preload stylesheet" href="/assets/style.DtFsVR9B.css" as="style">
<link rel="preload stylesheet" href="/vp-icons.css" as="style">
<script type="module" src="/assets/app.DFjSYdj3.js"></script>
<link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/assets/chunks/theme.CtIPYXhG.js">
<link rel="modulepreload" href="/assets/chunks/framework.C2AwuPrQ.js">
<link rel="modulepreload" href="/assets/zh_guide_migrate-from-v2.md.Df8wnmfP.lean.js">
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a: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>
</head>
<body>
<div id="app"><div class="Layout" data-v-1df9f90f><!--[--><!--]--><!--[--><span tabindex="-1" data-v-0b0ada53></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-0b0ada53>Skip to content</a><!--]--><!----><header class="VPNav" data-v-1df9f90f data-v-9f75dce3><div class="VPNavBar" data-v-9f75dce3 data-v-2a96a3d0><div class="wrapper" data-v-2a96a3d0><div class="container" data-v-2a96a3d0><div class="title" data-v-2a96a3d0><div class="VPNavBarTitle has-sidebar" data-v-2a96a3d0 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-2a96a3d0><div class="content-body" data-v-2a96a3d0><!--[--><!--]--><div class="VPNavBarSearch search" data-v-2a96a3d0><!--[--><!----><div id="docsearch"><button type="button" aria-label="Search" aria-keyshortcuts="/ control+k meta+k" class="DocSearch DocSearch-Button"><span class="DocSearch-Button-Container"><span class="vpi-search DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key"></kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-2a96a3d0 data-v-39714824><span id="main-nav-aria-label" class="visually-hidden" data-v-39714824> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/zh/guide/" tabindex="0" data-v-39714824 data-v-e56f3d57><!--[--><span data-v-e56f3d57>构建指南</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/zh/develop/" tabindex="0" data-v-39714824 data-v-e56f3d57><!--[--><span data-v-e56f3d57>开发者</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/zh/contributing/" tabindex="0" data-v-39714824 data-v-e56f3d57><!--[--><span data-v-e56f3d57>贡献</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/zh/faq/" tabindex="0" data-v-39714824 data-v-e56f3d57><!--[--><span data-v-e56f3d57>FAQ</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-39714824 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-cd834e02><a class="VPLink link" href="/zh/" data-v-cd834e02><!--[--><span data-v-cd834e02>v3 (alpha)</span><!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-25a6cce8 data-v-cd834e02><a class="VPLink link vp-external-link-icon" href="https://static-php.github.io/v2-docs/" target="_blank" rel="noreferrer" data-v-cd834e02><!--[--><span data-v-cd834e02>v2</span><!--]--></a></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--]--></nav><div class="VPFlyout VPNavBarTranslations translations" data-v-2a96a3d0 data-v-88af2de4 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-88af2de4><p class="title" data-v-88af2de4>简体中文</p><!--[--><div class="VPMenuLink" data-v-88af2de4 data-v-cd834e02><a class="VPLink link" href="/en/guide/migrate-from-v2.html" data-v-cd834e02><!--[--><span data-v-cd834e02>English</span><!--]--></a></div><!--]--></div><!--]--><!--]--
<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>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 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 / -Pbuild 命令)”"></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>这两个选项已不再被命令行接受。请改为设置 <code>PHP_SDK_PATH</code> 环境变量,指向你的 PHP SDK binary tools 目录。Visual Studio 版本现在由工具链配置统一管理。</p><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=&lt;list&gt;</code></td><td><code>--with-packages=&lt;list&gt;</code></td><td></td></tr><tr><td><code>--with-suggested-libs</code> / <code>-L</code></td><td><code>--with-suggests</code></td><td><code>-L</code> / <code>-E</code> 已移除</td></tr><tr><td><code>--with-suggested-exts</code> / <code>-E</code></td><td><code>--with-suggests</code></td><td>已合并为单一标志</td></tr></tbody></table><h3 id="示例" tabindex="-1">示例 <a class="header-anchor" href="#示例" aria-label="Permalink to “示例”"></a></h3><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 styl
<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;">&quot;openssl&quot;</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>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 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;">&quot;openssl&quot;</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:#6A737D;--shiki-dark:#6A737D;"># v2 — 需要两步</span></span>
<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>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 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 &lt;package&gt;</code></td></tr><tr><td><code>dev:ext-version</code> / <code>dev:ext-ver</code></td><td><code>spc dev:info &lt;package&gt;</code></td></tr><tr><td><code>dev:lib-version</code> / <code>dev:lib-ver</code></td><td><code>spc dev:info &lt;package&gt;</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:#22863A;--shiki-dark:#85E89D;">build-options</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--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:#6A737D;--shiki-dark:#6A737D;"># v2</span></span>
<span class="line"><span style="--shiki-light:#22863A;--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>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># v3推荐</span></span>
<span class="line"><span style="--shiki-light:#22863A;--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-e257564d><!--[--><!--]--><!----><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/zh/guide/cli-reference.html" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>Previous page</span><span class="title" data-v-e257564d>命令行参考</span><!--]--></a></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/zh/guide/extensions.html" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>Next page</span><span class="title" data-v-e257564d>支持的扩展列表</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-1df9f90f 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\":\"DaRp5sDR\",\"en_contributing_index.md\":\"Bw6aGZo7\",\"en_develop_artifact-model.md\":\"Be9wN_ZU\",\"en_develop_build-lifecycle.md\":\"BrkkrOI9\",\"en_develop_craft-yml.md\":\"CJqlRAWM\",\"en_develop_doctor-module.md\":\"BPx_gh7b\",\"en_develop_extending_annotations.md\":\"rWEgD5t7\",\"en_develop_extending_custom-artifact.md\":\"BQoftnUi\",\"en_develop_extending_dependency-injection.md\":\"3RvnsJs8\",\"en_develop_extending_index.md\":\"CBALgGvM\",\"en_develop_extending_lifecycle-hooks.md\":\"TH51ajMN\",\"en_develop_extending_package-classes.md\":\"DL47sxq4\",\"en_develop_index.md\":\"CDPdLdXm\",\"en_develop_package-model.md\":\"D5wiXvya\",\"en_develop_php-src-changes.md\":\"CIUUevPf\",\"en_develop_registry.md\":\"B5tf5XnG\",\"en_develop_structure.md\":\"B3aY4J4P\",\"en_develop_system-build-tools.md\":\"aR6vgJMi\",\"en_faq_index.md\":\"ButqLRAC\",\"en_guide_cli-generator.md\":\"Bh1mnldB\",\"en_guide_cli-reference.md\":\"B6zUxFdM\",\"en_guide_deps-map.md\":\"B9M0h5GJ\",\"en_guide_env-vars.md\":\"B5JOZL1S\",\"en_guide_extension-notes.md\":\"C1QFg1E9\",\"en_guide_extensions.md\":\"CYT0fXgd\",\"en_guide_first-build.md\":\"C3LOd79t\",\"en_guide_index.md\":\"Chrx4Kg2\",\"en_guide_installation.md\":\"DNcSrgIL\",\"en_guide_migrate-from-v2.md\":\"CfVymFnT\",\"en_guide_sapi-reference.md\":\"Dx3FnmW6\",\"en_guide_troubleshooting.md\":\"Mc4ZUzP-\",\"en_index.md\":\"CZz4hp1l\",\"index.md\":\"DlohUUjo\",\"zh_contributing_index.md\":\"BxNPLW0M\",\"zh_develop_artifact-model.md\":\"BtcNBk1j\",\"zh_develop_build-lifecycle.md\":\"D1JbjvDB\",\"zh_develop_craft-yml.md\":\"oQn7yY_F\",\"zh_develop_doctor-module.md\":\"DAzJoWwn\",\"zh_develop_extending_annotations.md\":\"DAa7FG7j\",\"zh_develop_extending_custom-artifact.md\":\"BTEWH7KO\",\"zh_develop_extending_dependency-injection.md\":\"PLkrv44m\",\"zh_develop_extending_index.md\":\"B478Mpx4\",\"zh_develop_extending_lifecycle-hooks.md\":\"BNdlHrBu\",\"zh_develop_extending_package-classes.md\":\"CLofM-pE\",\"zh_develop_index.md\":\"CYr92Q4h\",\"zh_develop_package-model.md\":\"DYRZ8aaf\",\"zh_develop_php-src-changes.md\":\"QIFUEZHE\",\"zh_develop_registry.md\":\"BvRBmoGT\",\"zh_develop_structure.md\":\"EpUhxfrR\",\"zh_develop_system-build-tools.md\":\"DEEE1raf\",\"zh_faq_index.md\":\"DkTldA8b\",\"zh_guide_cli-generator.md\":\"Djvjm7dZ\",\"zh_guide_cli-reference.md\":\"DMttieGz\",\"zh_guide_deps-map.md\":\"BsudOLor\",\"zh_guide_env-vars.md\":\"Bs72W99k\",\"zh_guide_extension-notes.md\":\"D-KMlaiu\",\"zh_guide_extensions.md\":\"CdF_j2fu\",\"zh_guide_first-build.md\":\"CQdFhKsg\",\"zh_guide_index.md\":\"B1jsb7XJ\",\"zh_guide_installation.md\":\"Ap2snxXu\",\"zh_guide_migrate-from-v2.md\":\"Df8wnmfP\",\"zh_guide_sapi-reference.md\":\"DXv5eV6I\",\"zh_guide_troubleshooting.md\":\"CueHHZkW\",\"zh_index.md\":\"CkWIeJB6\"}");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/\
</body>
</html>