import{_ass,casa,oast,ajase}from"./chunks/framework.C2AwuPrQ.js";constc=JSON.parse('{"title":"Installation","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/installation.md","filePath":"en/guide/installation.md"}'),n={name:"en/guide/installation.md"};functionl(h,i,p,d,r,o){returnt(),a("div",null,[...i[0]||(i[0]=[e(`<h1 id="installation" tabindex="-1">Installation <a class="header-anchor" href="#installation" aria-label="Permalink to “Installation”"></a></h1><h2 id="requirements" tabindex="-1">Requirements <a class="header-anchor" href="#requirements" aria-label="Permalink to “Requirements”"></a></h2><table tabindex="0"><thead><tr><th>Platform</th><th>Architecture</th><th>Notes</th></tr></thead><tbody><tr><td>Linux</td><td>x86_64, aarch64</td><td>Major distros supported (Alpine, Debian/Ubuntu, RHEL/CentOS, etc.)</td></tr><tr><td>macOS</td><td>x86_64 (Intel), arm64 (Apple Silicon)</td><td>macOS 12 or later</td></tr><tr><td>Windows</td><td>x86_64</td><td>Windows 10 Build 17063 or later</td></tr></tbody></table><div class="tip custom-block"><p class="custom-block-title custom-block-title-default">TIP</p><p>Both glibc-based distros (Debian, Ubuntu, Arch, etc.) and musl-based ones (Alpine) are supported on Linux. The <code>doctor</code> command will detect your environment and guide you through installing the right toolchain if needed.</p></div><p>Pick the installation method that fits your use case:</p><table tabindex="0"><thead><tr><th>Method</th><th>Best for</th></tr></thead><tbody><tr><td>Pre-built binary</td><td>Most users — download and run, no dependencies</td></tr><tr><td>From source</td><td>Contributors, or anyone who needs to modify core build logic</td></tr><tr><td>Vendor mode</td><td>Integrating StaticPHP into an existing PHP project</td></tr></tbody></table><h2 id="pre-built-binary" tabindex="-1">Pre-built binary <a class="header-anchor" href="#pre-built-binary" aria-label="Permalink to “Pre-built binary”"></a></h2><p><code>spc</code> has no runtime dependencies — download the binary for your platform and it's ready to go.</p><blockquote><p>Fun fact: <code>spc</code> itself is a static PHP binary built with StaticPHP. We use StaticPHP to build StaticPHP's own build tool.</p></blockquote><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</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;"># Linux x86_64</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;">#Addthisto~/.bashrc or ~/.zshrctomakeitpermanent</span></span></code></pre></div></li></ol><h2id="vendor-mode"tabindex="-1">Vendormode<aclass="header-anchor"href="#vendor-mode"aria-label="Permalinkto“Vendormode”"></a></h2><p>IfyoualreadyhaveaPHPprojectandwanttocallStaticPHP'sbuildAPIsdirectly,oruseacustomregistrytosupportprivatelibrariesandextensions,pullitinasaComposerdependency:</p><divclass="language-bash"><buttontitle="CopyCode"class="copy"></button><spanclass="lang">bash</span><preclass="shikishiki-themesgithub-lightgithub-dark"style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;"tabindex="0"dir="ltr"><code><spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">composer</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">require</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">crazywhalecc/static-php-cli</span></span></code></pre></div><p>Seethe<ahref="./../develop/extending/">ExtendingStaticPHP</a>guidefordetails.</p><h2id="verify-your-build-environment"tabindex="-1">Verifyyourbuildenvironment<aclass="header-anchor"href="#verify-your-build-environment"aria-label="Permalinkto“Verifyyourbuildenvironment”"></a></h2><blockquote><p><strong>Vendormodeuserscanskipthisstep.</strong></p></blockquote><p>Onceinstalled,run<code>doctor</code>tocheckthatyoursystemhastherequiredbuildtools(cmake,make,aCcompiler,etc.):</p><divclass="language-bash"><buttontitle="CopyCode"class="copy"></button><spanclass="lang">bash</span><preclass="shikishiki-themesgithub-lightgithub-dark"style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;"tabindex="0"dir="ltr"><code><spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;">#Usingthespcbinary</span></span>