Files
static-php-cli/en/guide/first-build.html
2026-07-16 06:25:16 +00:00

53 lines
47 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Your First Build | 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.18">
<link rel="preload stylesheet" href="/assets/style.C4OPn_QV.css" as="style">
<link rel="preload stylesheet" href="/vp-icons.css" as="style">
<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/en_guide_first-build.md.INdBGOsG.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>
</head>
<body>
<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="/en/" 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="/en/guide/" tabindex="0" data-v-7b3e138d data-v-6500c4c4><!--[--><span data-v-6500c4c4>Guide</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/en/develop/" tabindex="0" data-v-7b3e138d data-v-6500c4c4><!--[--><span data-v-6500c4c4>Develop</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/en/contributing/" tabindex="0" data-v-7b3e138d data-v-6500c4c4><!--[--><span data-v-6500c4c4>Contributing</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/en/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="/en/" 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>English</p><!--[--><div class="VPMenuLink" data-v-c70a0580 data-v-fff73daa><a class="VPLink link" href="/zh/guide/first-build.html" rel="alternate" lang="zh" hreflang="zh" data-v-fff73daa><!--[--><span data-v-fff73daa>简体中文</span><!--]--></a></div><!--]--></div><!--]--><!--]--></div></div></div><div class="VPNavBarAppearance appearance" data-v-9ca1369d data-v-6c893767><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-6c893767 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-9ca1369d data-v-0394ad82 data-v-aab4b505><!--[--><a class="VPSocialLink no-icon" href="https://github.com/crazywhalecc/static-php-cli" aria-label="github" target="_blank" rel="me noopener" data-v-aab4b505 data-v-b2b39822><span class="vpi-social-github"></span></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-9ca1369d data-v-f9c1cef3 data-v-42cb505d><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-42cb505d><span class="vpi-more-horizontal icon" data-v-42cb505d></span></button><div class="menu" data-v-42cb505d><div class="VPMenu" data-v-42cb505d data-v-25a6cce8><!----><!--[--><!--[--><div class="group translations" data-v-f9c1cef3><p class="trans-title" data-v-f9c1cef3>English</p><!--[--><div class="VPMenuLink" data-v-f9c1cef3 data-v-fff73daa><a class="VPLink link" href="/zh/guide/first-build.html" rel="alternate" lang="zh" hreflang="zh" data-v-fff73daa><!--[--><span data-v-fff73daa>简体中文</span><!--]--></a></div><!--]--></div><div class="group" data-v-f9c1cef3><div class="item appearance" data-v-f9c1cef3><p class="label" data-v-f9c1cef3>Appearance</p><div class="appearance-action" data-v-f9c1cef3><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-f9c1cef3 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div></div></div><div class="group" data-v-f9c1cef3><div class="item social-links" data-v-f9c1cef3><div class="VPSocialLinks social-links-list" data-v-f9c1cef3 data-v-aab4b505><!--[--><a class="VPSocialLink no-icon" href="https://github.com/crazywhalecc/static-php-cli" aria-label="github" target="_blank" rel="me noopener" data-v-aab4b505 data-v-b2b39822><span class="vpi-social-github"></span></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-9ca1369d data-v-e5dd9c1c><span class="container" data-v-e5dd9c1c><span class="top" data-v-e5dd9c1c></span><span class="middle" data-v-e5dd9c1c></span><span class="bottom" data-v-e5dd9c1c></span></span></button></div></div></div></div><div class="divider" data-v-9ca1369d><div class="divider-line" data-v-9ca1369d></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-0cf61682 data-v-db738f89><div class="container" data-v-db738f89><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-db738f89><span class="vpi-align-left menu-icon" data-v-db738f89></span><span class="menu-text" data-v-db738f89>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-db738f89 data-v-0bf0e06f><button data-v-0bf0e06f>Return to top</button><!----></div></div></div><aside class="VPSidebar" data-v-0cf61682 data-v-af661f50><div class="curtain" data-v-af661f50></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-af661f50><span class="visually-hidden" id="sidebar-aria-label" data-v-af661f50> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-8d50c081><section class="VPSidebarItem level-0 has-active" data-v-8d50c081 data-v-d81de50c><div class="item" role="button" tabindex="0" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><h2 class="text" data-v-d81de50c>Getting Started</h2><!----></div><div class="items" data-v-d81de50c><!--[--><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Overview</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/installation.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Installation</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/first-build.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>First Build</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/sapi-reference.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>PHP SAPI Reference</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/cli-reference.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>CLI Reference</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/migrate-from-v2.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Migrating from v2</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-8d50c081><section class="VPSidebarItem level-0" data-v-8d50c081 data-v-d81de50c><div class="item" role="button" tabindex="0" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><h2 class="text" data-v-d81de50c>Extensions</h2><!----></div><div class="items" data-v-d81de50c><!--[--><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/extensions.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Supported Extensions</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/extension-notes.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Extension Notes</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/cli-generator.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Build Command Generator</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-8d50c081><section class="VPSidebarItem level-0" data-v-8d50c081 data-v-d81de50c><div class="item" role="button" tabindex="0" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><h2 class="text" data-v-d81de50c>Reference</h2><!----></div><div class="items" data-v-d81de50c><!--[--><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/env-vars.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Environment Variables</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/deps-map.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Dependency Table</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/troubleshooting.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Troubleshooting</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-0cf61682 data-v-7948e71f><div class="VPDoc has-sidebar has-aside" data-v-7948e71f data-v-7011f0d8><!--[--><!--]--><div class="container" data-v-7011f0d8><div class="aside" data-v-7011f0d8><div class="aside-curtain" data-v-7011f0d8></div><div class="aside-container" data-v-7011f0d8><div class="aside-content" data-v-7011f0d8><div class="VPDocAside" data-v-7011f0d8 data-v-62132652><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-62132652 data-v-208c587c><div class="content" data-v-208c587c><div class="outline-marker" data-v-208c587c></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-208c587c>On this page</div><ul class="VPDocOutlineItem root" data-v-208c587c data-v-1ce71065><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-62132652></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-7011f0d8><div class="content-container" data-v-7011f0d8><!--[--><!--]--><main class="main" data-v-7011f0d8><div style="position:relative;" class="vp-doc _en_guide_first-build external-link-icon-enabled" data-v-7011f0d8><div><h1 id="your-first-build" tabindex="-1">Your First Build <a class="header-anchor" href="#your-first-build" aria-label="Permalink to “Your First Build”"></a></h1><p>This page walks you through building a static PHP binary from scratch, end to end.</p><div class="tip custom-block"><p class="custom-block-title custom-block-title-default">TIP</p><p>If you installed spc as a pre-built binary, replace every <code>spc</code> in this page with <code>./spc</code> (or <code>.\spc.exe</code> on Windows).</p><p>If you installed from source, use <code>bin/spc</code> instead.</p></div><h2 id="two-approaches" tabindex="-1">Two Approaches <a class="header-anchor" href="#two-approaches" aria-label="Permalink to “Two Approaches”"></a></h2><p>StaticPHP supports two build workflows — pick the one that fits your situation:</p><table tabindex="0"><thead><tr><th>Approach</th><th>When to use</th></tr></thead><tbody><tr><td><code>craft</code> (one-shot)</td><td>Everyday use, getting started quickly</td></tr><tr><td>Step-by-step</td><td>Fine-grained control over the build pipeline</td></tr></tbody></table><h2 id="option-1-one-shot-build-with-craft-recommended" tabindex="-1">Option 1: One-Shot Build with <code>craft</code> (Recommended) <a class="header-anchor" href="#option-1-one-shot-build-with-craft-recommended" aria-label="Permalink to “Option 1: One-Shot Build with craft (Recommended)”"></a></h2><p>The <code>craft</code> command reads a <code>craft.yml</code> file and handles everything automatically — downloading dependencies, compiling libraries, and building PHP — in a single run.</p><h3 id="write-craft-yml" tabindex="-1">Write craft.yml <a class="header-anchor" href="#write-craft-yml" aria-label="Permalink to “Write craft.yml”"></a></h3><p>Create a <code>craft.yml</code> in your working directory and declare the PHP version, extensions, and target SAPIs:</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:#11782a;--shiki-dark:#85E89D;">php-version</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">8.5</span></span>
<span class="line"><span style="--shiki-light:#11782a;--shiki-dark:#85E89D;">extensions</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">bcmath,posix,phar,zlib,openssl,curl,fileinfo,tokenizer</span></span>
<span class="line"><span style="--shiki-light:#11782a;--shiki-dark:#85E89D;">sapi</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;">cli</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> - </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">micro</span></span></code></pre></div><p>Not sure which extensions you need? Use the <a href="./cli-generator.html">command generator</a> to produce a <code>craft.yml</code> automatically.</p><h3 id="run-the-build" tabindex="-1">Run the Build <a class="header-anchor" href="#run-the-build" aria-label="Permalink to “Run the Build”"></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 style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> craft</span></span></code></pre></div><p>The build pipeline runs in order: download dependencies → compile libraries → compile PHP. No interaction required.</p><p>To see more detail, pass <code>-v</code>, <code>-vv</code>, or <code>-vvv</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;"> craft</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -v</span></span></code></pre></div><h3 id="inspect-the-output" tabindex="-1">Inspect the Output <a class="header-anchor" href="#inspect-the-output" aria-label="Permalink to “Inspect the Output”"></a></h3><p>On success, binaries land in <code>buildroot/bin/</code>:</p><table tabindex="0"><thead><tr><th>SAPI</th><th>Output path</th></tr></thead><tbody><tr><td>cli</td><td><code>buildroot/bin/php</code> (Windows: <code>buildroot/bin/php.exe</code>)</td></tr><tr><td>fpm</td><td><code>buildroot/bin/php-fpm</code></td></tr><tr><td>micro</td><td><code>buildroot/bin/micro.sfx</code></td></tr><tr><td>embed</td><td><code>buildroot/lib/libphp.a</code></td></tr><tr><td>frankenphp</td><td><code>buildroot/bin/frankenphp</code></td></tr></tbody></table><p>Give the CLI binary a quick smoke-test:</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;">./buildroot/bin/php</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -v</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./buildroot/bin/php</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -m</span></span></code></pre></div><h2 id="option-2-step-by-step-build" tabindex="-1">Option 2: Step-by-Step Build <a class="header-anchor" href="#option-2-step-by-step-build" aria-label="Permalink to “Option 2: Step-by-Step Build”"></a></h2><p>This approach lets you run download and compile as separate steps — useful when you want to cache downloads in CI and reuse them across builds.</p><h3 id="step-1-download-dependencies" tabindex="-1">Step 1: Download Dependencies <a class="header-anchor" href="#step-1-download-dependencies" aria-label="Permalink to “Step 1: Download Dependencies”"></a></h3><p>In v3, you can skip this step entirely — running <code>build:php</code> directly will automatically download any missing artifacts.</p><p>If you want to pre-download ahead of time, or if you&#39;re working in a slow-network environment and want to separate the download phase, use the <code>download</code> command:</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;"># Download only what the chosen extensions need (recommended)</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=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;bcmath,posix,phar,zlib,openssl,curl,fileinfo,tokenizer&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --with-php=8.5</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#62687b;--shiki-dark:#818e99;"># Download by specific package names</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:#032F62;--shiki-dark:#9ECBFF;"> &quot;curl,openssl&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --with-php=8.5</span></span></code></pre></div><p>Downloads are cached in <code>downloads/</code> and reused across builds automatically.</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;"># Slow connection? Increase parallelism and retries</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=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;bcmath,openssl,curl&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --parallel</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 10</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --retry=3</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#62687b;--shiki-dark:#818e99;"># Use pre-built binaries where available — skips compiling those dependencies</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=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;bcmath,openssl,curl&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --prefer-binary</span></span></code></pre></div><h3 id="step-2-build-php" tabindex="-1">Step 2: Build PHP <a class="header-anchor" href="#step-2-build-php" aria-label="Permalink to “Step 2: Build PHP”"></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 style="--shiki-light:#62687b;--shiki-dark:#818e99;"># Build the cli SAPI</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</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;bcmath,phar,zlib,openssl,curl,fileinfo,tokenizer&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build-cli</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#62687b;--shiki-dark:#818e99;"># Build multiple SAPIs in one go</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</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;bcmath,phar,zlib,openssl,curl&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build-cli</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build-micro</span></span></code></pre></div><h4 id="common-build-options" tabindex="-1">Common Build Options <a class="header-anchor" href="#common-build-options" aria-label="Permalink to “Common Build Options”"></a></h4><table tabindex="0"><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><code>--build-cli</code></td><td>Build the cli SAPI</td></tr><tr><td><code>--build-fpm</code></td><td>Build php-fpm (not available on Windows)</td></tr><tr><td><code>--build-micro</code></td><td>Build micro.sfx</td></tr><tr><td><code>--build-embed</code></td><td>Build the embed SAPI</td></tr><tr><td><code>--build-frankenphp</code></td><td>Build FrankenPHP</td></tr><tr><td><code>--enable-zts</code></td><td>Enable thread-safe (ZTS) mode</td></tr><tr><td><code>--no-strip</code></td><td>Keep debug symbols; do not strip the binary</td></tr><tr><td><code>-I key=value</code></td><td>Hard-compile an INI option into PHP</td></tr><tr><td><code>--with-upx-pack</code></td><td>Compress output with UPX (run <code>spc install-pkg upx</code> first)</td></tr></tbody></table><p>Example — baking in a larger memory limit and disabling the <code>system</code> function:</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</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;bcmath,pcntl,posix&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build-cli</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -I</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;memory_limit=4G&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -I</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;disable_functions=system&quot;</span></span></code></pre></div><h2 id="packaging-a-micro-app" tabindex="-1">Packaging a micro App <a class="header-anchor" href="#packaging-a-micro-app" aria-label="Permalink to “Packaging a micro App”"></a></h2><p>Once you have <code>micro.sfx</code>, use <code>micro:combine</code> to bundle your PHP code into a single self-contained executable:</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:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;&lt;?php echo &#39;Hello, World!&#39; . PHP_EOL;&quot;</span><span style="--shiki-light:#c62739;--shiki-dark:#F97583;"> &gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> hello.php</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> micro:combine</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> hello.php</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --output=hello</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./hello</span></span></code></pre></div><p>Works with <code>.phar</code> files too, and you can inject INI settings at packaging time:</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;"># Bundle a phar</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> micro:combine</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> your-app.phar</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --output=your-app</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#62687b;--shiki-dark:#818e99;"># Inject INI via command-line options</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> micro:combine</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> your-app.phar</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --output=your-app</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -I</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;memory_limit=512M&quot;</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#62687b;--shiki-dark:#818e99;"># Inject INI from a file</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> micro:combine</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> your-app.phar</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --output=your-app</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -N</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /path/to/custom.ini</span></span></code></pre></div><h2 id="debugging-and-rebuilding" tabindex="-1">Debugging and Rebuilding <a class="header-anchor" href="#debugging-and-rebuilding" aria-label="Permalink to “Debugging and Rebuilding”"></a></h2><p>If a build fails or you want to trace what&#39;s happening, use <code>-v</code> / <code>-vv</code> / <code>-vvv</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</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;bcmath,openssl&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build-cli</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -vv</span></span></code></pre></div><ul><li><code>-v</code> shows <code>INFO</code>-level logs: which modules are running and what build commands are being executed.</li><li><code>-vv</code> shows <code>DEBUG</code>-level logs: all internal debug output from StaticPHP.</li><li><code>-vvv</code> shows <code>DEBUG</code>-level logs and also pipes the stdout of every shell command directly to your terminal.</li></ul><p>To wipe compiled artifacts and start fresh without re-downloading, run <code>reset</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;"> reset</span></span>
<span class="line"><span style="--shiki-light:#62687b;--shiki-dark:#818e99;"># Then rebuild</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</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;bcmath,openssl&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build-cli</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title custom-block-title-default">TIP</p><p><code>reset</code> only removes <code>buildroot/</code> and <code>source/</code>. Your <code>downloads/</code> cache is preserved. Add <code>--with-download</code> if you also want to clear the download cache.</p></div><p>If you&#39;re stuck, open an <a href="https://github.com/static-php/static-php-cli/issues" target="_blank" rel="noreferrer">Issue</a> and include your <code>craft.yml</code> (if any) and a zip of the <code>log/</code> directory.</p><h2 id="what-s-next" tabindex="-1">What&#39;s Next <a class="header-anchor" href="#what-s-next" aria-label="Permalink to “What&#39;s Next”"></a></h2><ul><li><a href="./sapi-reference.html">PHP SAPI Reference</a> — Build options and usage guide for each PHP SAPI</li><li><a href="./cli-reference.html">CLI Reference</a> — Full documentation for every command and option</li><li><a href="./extensions.html">Extensions</a> — Browse supported extensions and their dependencies</li><li><a href="./troubleshooting.html">Troubleshooting</a> — Diagnose common build failures</li></ul></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="/en/guide/installation.html" data-v-e29034c6><!--[--><span class="desc" data-v-e29034c6>Previous page</span><span class="title" data-v-e29034c6>Installation</span><!--]--></a></div><div class="pager" data-v-e29034c6><a class="VPLink link pager-link next" href="/en/guide/sapi-reference.html" data-v-e29034c6><!--[--><span class="desc" data-v-e29034c6>Next page</span><span class="title" data-v-e29034c6>PHP SAPI Reference</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/\"},{\"text\":\"v2\",\"link\":\"https://static-php.github.io/v2-docs/\"}]}],\"sidebar\":{\"/en/guide/\":[{\"text\":\"Getting Started\",\"items\":[{\"text\":\"Overview\",\"link\":\"/en/guide/\"},{\"text\":\"Installation\",\"link\":\"/en/guide/installation\"},{\"text\":\"First Build\",\"link\":\"/en/guide/first-build\"},{\"text\":\"PHP SAPI Reference\",\"link\":\"/en/guide/sapi-reference\"},{\"text\":\"CLI Reference\",\"link\":\"/en/guide/cli-reference\"},{\"text\":\"Migrating from v2\",\"link\":\"/en/guide/migrate-from-v2\"}]},{\"text\":\"Extensions\",\"items\":[{\"text\":\"Supported Extensions\",\"link\":\"/en/guide/extensions\"},{\"text\":\"Extension Notes\",\"link\":\"/en/guide/extension-notes\"},{\"text\":\"Build Command Generator\",\"link\":\"/en/guide/cli-generator\"}]},{\"text\":\"Reference\",\"items\":[{\"text\":\"Environment Variables\",\"link\":\"/en/guide/env-vars\"},{\"text\":\"Dependency Table\",\"link\":\"/en/guide/deps-map\"},{\"text\":\"Troubleshooting\",\"link\":\"/en/guide/troubleshooting\"}]}],\"/en/develop/\":[{\"text\":\"Overview\",\"items\":[{\"text\":\"Get Started\",\"link\":\"/en/develop/\"},{\"text\":\"Project Structure\",\"link\":\"/en/develop/structure\"}]},{\"text\":\"Configuration Reference\",\"items\":[{\"text\":\"Registry\",\"link\":\"/en/develop/registry\"},{\"text\":\"Package Model\",\"link\":\"/en/develop/package-model\"},{\"text\":\"Artifact Model\",\"link\":\"/en/develop/artifact-model\"},{\"text\":\"craft.yml\",\"link\":\"/en/develop/craft-yml\"}]},{\"text\":\"Build System\",\"items\":[{\"text\":\"Build Lifecycle\",\"link\":\"/en/develop/build-lifecycle\"},{\"text\":\"Compilation Tools\",\"link\":\"/en/develop/system-build-tools\"},{\"text\":\"Doctor\",\"link\":\"/en/develop/doctor-module\"},{\"text\":\"PHP Source Modifications\",\"link\":\"/en/develop/php-src-changes\"}]},{\"text\":\"Extending StaticPHP\",\"items\":[{\"text\":\"Introduction\",\"link\":\"/en/develop/extending/\"},{\"text\":\"Writing Package Classes\",\"link\":\"/en/develop/extending/package-classes\"},{\"text\":\"Annotations Reference\",\"link\":\"/en/develop/extending/annotations\"},{\"text\":\"Lifecycle Hooks\",\"link\":\"/en/develop/extending/lifecycle-hooks\"},{\"text\":\"Dependency Injection\",\"link\":\"/en/develop/extending/dependency-injection\"},{\"text\":\"Custom Artifact\",\"link\":\"/en/develop/extending/custom-artifact\"}]}],\"/en/contributing/\":[{\"text\":\"Contributing\",\"items\":[{\"text\":\"Contributing Guide\",\"link\":\"/en/contributing/\"}]}],\"/en/faq/\":[{\"text\":\"FAQ\",\"items\":[{\"text\":\"Frequently Asked Questions\",\"link\":\"/en/faq/\"}]}]},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2023-present crazywhalecc\"}}},\"zh\":{\"label\":\"简体中文\",\"lang\":\"zh\",\"themeConfig\":{\"nav\":[{\"text\":\"构建指南\",\"link\":\"/zh/guide/\"},{\"text\":\"开发者\",\"link\":\"/zh/develop/\"},{\"text\":\"贡献\",\"link\":\"/zh/contributing/\"},{\"text\":\"FAQ\",\"link\":\"/zh/faq/\"},{\"text\":\"v3 (alpha)\",\"items\":[{\"text\":\"v3 (alpha)\",\"link\":\"/zh/\"},{\"text\":\"v2\",\"link\":\"https://static-php.github.io/v2-docs/\"}]}],\"sidebar\":{\"/zh/guide/\":[{\"text\":\"快速上手\",\"items\":[{\"text\":\"概览\",\"link\":\"/zh/guide/\"},{\"text\":\"安装\",\"link\":\"/zh/guide/installation\"},{\"text\":\"第一次构建\",\"link\":\"/zh/guide/first-build\"},{\"text\":\"PHP SAPI 构建参考\",\"link\":\"/zh/guide/sapi-reference\"},{\"text\":\"命令行参考\",\"link\":\"/zh/guide/cli-reference\"},{\"text\":\"从 v2 迁移\",\"link\":\"/zh/guide/migrate-from-v2\"}]},{\"text\":\"扩展\",\"items\":[{\"text\":\"支持的扩展列表\",\"link\":\"/zh/guide/extensions\"},{\"text\":\"扩展注意事项\",\"link\":\"/zh/guide/extension-notes\"},{\"text\":\"命令生成器\",\"link\":\"/zh/guide/cli-generator\"}]},{\"text\":\"参考\",\"items\":[{\"text\":\"环境变量\",\"link\":\"/zh/guide/env-vars\"},{\"text\":\"依赖关系图\",\"link\":\"/zh/guide/deps-map\"},{\"text\":\"故障排除\",\"link\":\"/zh/guide/troubleshooting\"}]}],\"/zh/develop/\":[{\"text\":\"概览\",\"items\":[{\"text\":\"开发简介\",\"link\":\"/zh/develop/\"},{\"text\":\"项目结构\",\"link\":\"/zh/develop/structure\"}]},{\"text\":\"配置参考\",\"items\":[{\"text\":\"Registry\",\"link\":\"/zh/develop/registry\"},{\"text\":\"Package 模型\",\"link\":\"/zh/develop/package-model\"},{\"text\":\"Artifact 模型\",\"link\":\"/zh/develop/artifact-model\"},{\"text\":\"craft.yml 配置\",\"link\":\"/zh/develop/craft-yml\"}]},{\"text\":\"构建系统\",\"items\":[{\"text\":\"构建生命周期\",\"link\":\"/zh/develop/build-lifecycle\"},{\"text\":\"编译工具\",\"link\":\"/zh/develop/system-build-tools\"},{\"text\":\"Doctor 环境检查\",\"link\":\"/zh/develop/doctor-module\"},{\"text\":\"对 PHP 源码的修改\",\"link\":\"/zh/develop/php-src-changes\"}]},{\"text\":\"扩展 StaticPHP\",\"items\":[{\"text\":\"简介\",\"link\":\"/zh/develop/extending/\"},{\"text\":\"编写 Package 类\",\"link\":\"/zh/develop/extending/package-classes\"},{\"text\":\"注解参考\",\"link\":\"/zh/develop/extending/annotations\"},{\"text\":\"生命周期 Hook\",\"link\":\"/zh/develop/extending/lifecycle-hooks\"},{\"text\":\"依赖注入\",\"link\":\"/zh/develop/extending/dependency-injection\"},{\"text\":\"自定义 Artifact\",\"link\":\"/zh/develop/extending/custom-artifact\"}]}],\"/zh/contributing/\":[{\"text\":\"贡献指南\",\"items\":[{\"text\":\"贡献指南\",\"link\":\"/zh/contributing/\"}]}],\"/zh/faq/\":[{\"text\":\"FAQ\",\"items\":[{\"text\":\"常见问题\",\"link\":\"/zh/faq/\"}]}]},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2023-present crazywhalecc\"}}}},\"cleanUrls\":false,\"additionalConfig\":{}}");</script>
</body>
</html>