This commit is contained in:
crazywhalecc
2025-08-07 05:09:55 +00:00
parent 63e3c6df8c
commit 9b9b6c3cbf
54 changed files with 56 additions and 56 deletions

View File

@@ -39,7 +39,7 @@ import{_ as s,c as e,o as a,af as n}from"./chunks/framework.PeLcR_tw.js";const k
<span class="line"><span style="--shiki-light:#22863A;--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:#22863A;--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;">fpm</span></span></code></pre></div><p>Then use the <code>bin/spc craft</code> command to compile:</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;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> craft</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --debug</span></span></code></pre></div><p>If the build is successful, you will see the <code>buildroot/bin</code> directory in the current directory, which contains the compiled PHP binary file, or the corresponding SAPI.</p><ul><li>cli: The build result is <code>buildroot/bin/php.exe</code> on Windows and <code>buildroot/bin/php</code> on other platforms.</li><li>fpm: The build result is <code>buildroot/bin/php-fpm</code>.</li><li>micro: The build result is <code>buildroot/bin/micro.sfx</code>. If you need to further package it with PHP code, please refer to <a href="./manual-build.html#command-micro-combine">Packaging micro binary</a>.</li><li>embed: See <a href="./manual-build.html#embed-usage">Using embed</a>.</li><li>frankenphp: The build result is <code>buildroot/bin/frankenphp</code>.</li></ul><p>If the build fails, you can use the <code>--debug</code> parameter to view detailed error information, or use the <code>--with-clean</code> to clear the old compilation results and recompile.</p><p>If the build still fails to use the above method, please submit an issue and attach your <code>craft.yml</code> and <code>craft.log</code>.</p><h2 id="step-by-step-build-command" tabindex="-1">Step-by-step build command <a class="header-anchor" href="#step-by-step-build-command" aria-label="Permalink to Step-by-step build command"></a></h2><p>If you have customized requirements, or the need to download and compile PHP and dependent libraries separately, you can use the <code>bin/spc</code> command to execute step by step.</p><h3 id="command-download-download-dependency-packages" tabindex="-1">Command download - Download dependency packages <a class="header-anchor" href="#command-download-download-dependency-packages" aria-label="Permalink to Command download - Download dependency packages"></a></h3><p>Use the command <code>bin/spc download</code> to download the source code required for compilation, including php-src and the source code of various dependent libraries.</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;"># Download all dependencies, defaults to php 8.4</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> - </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">fpm</span></span></code></pre></div><p>Then use the <code>bin/spc craft</code> command to compile:</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;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> craft</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --debug</span></span></code></pre></div><p>If the build is successful, you will see the <code>buildroot/bin</code> directory in the current directory, which contains the compiled PHP binary file, or the corresponding SAPI.</p><ul><li>cli: The build result is <code>buildroot/bin/php.exe</code> on Windows and <code>buildroot/bin/php</code> on other platforms.</li><li>fpm: The build result is <code>buildroot/bin/php-fpm</code>.</li><li>micro: The build result is <code>buildroot/bin/micro.sfx</code>. If you need to further package it with PHP code, please refer to <a href="./manual-build.html#command-micro-combine">Packaging micro binary</a>.</li><li>embed: See <a href="./manual-build.html#embed-usage">Using embed</a>.</li><li>frankenphp: The build result is <code>buildroot/bin/frankenphp</code>.</li></ul><p>If the build fails, you can use the <code>--debug</code> parameter to view detailed error information, or use the <code>--with-clean</code> to clear the old compilation results and recompile.</p><p>If the build still fails to use the above method, please submit an issue and attach your <code>craft.yml</code> and <code>./log</code> archive.</p><h2 id="step-by-step-build-command" tabindex="-1">Step-by-step build command <a class="header-anchor" href="#step-by-step-build-command" aria-label="Permalink to Step-by-step build command"></a></h2><p>If you have customized requirements, or the need to download and compile PHP and dependent libraries separately, you can use the <code>bin/spc</code> command to execute step by step.</p><h3 id="command-download-download-dependency-packages" tabindex="-1">Command download - Download dependency packages <a class="header-anchor" href="#command-download-download-dependency-packages" aria-label="Permalink to Command download - Download dependency packages"></a></h3><p>Use the command <code>bin/spc download</code> to download the source code required for compilation, including php-src and the source code of various dependent libraries.</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;"># Download all dependencies, defaults to php 8.4</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> download</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --all</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Download all dependent packages, and specify the main version of PHP to download, optional: 8.1, 8.2, 8.3, 8.4</span></span>

View File

@@ -35,7 +35,7 @@ import{_ as i,c as a,o as n,af as l}from"./chunks/framework.PeLcR_tw.js";const o
<span class="line"><span style="--shiki-light:#22863A;--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:#22863A;--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;">fpm</span></span></code></pre></div><p>使 <code>bin/spc craft</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;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> craft</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --debug</span></span></code></pre></div><p> <code>buildroot/bin</code> PHP SAPI</p><ul><li>cli: Windows <code>buildroot/bin/php.exe</code> <code>buildroot/bin/php</code></li><li>fpm: <code>buildroot/bin/php-fpm</code></li><li>micro: <code>buildroot/bin/micro.sfx</code> PHP <a href="./manual-build.html#-micro-combine--micro-"> micro </a></li><li>embed: <a href="./manual-build.html#embed-使">embed 使</a></li><li>frankenphp: <code>buildroot/bin/frankenphp</code></li></ul><p>使 <code>--debug</code> 使 <code>--with-clean</code> </p><p>使 issue <code>craft.yml</code><code>craft.log</code></p><h2 id="" tabindex="-1"> <a class="header-anchor" href="#" aria-label="Permalink to "></a></h2><p> PHP 使 <code>bin/spc</code> </p><h3 id="-download-" tabindex="-1"> download - <a class="header-anchor" href="#-download-" aria-label="Permalink to download - "></a></h3><p>使 <code>bin/spc download</code> php-src </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;"># 使</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> - </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">fpm</span></span></code></pre></div><p>使 <code>bin/spc craft</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;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> craft</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --debug</span></span></code></pre></div><p> <code>buildroot/bin</code> PHP SAPI</p><ul><li>cli: Windows <code>buildroot/bin/php.exe</code> <code>buildroot/bin/php</code></li><li>fpm: <code>buildroot/bin/php-fpm</code></li><li>micro: <code>buildroot/bin/micro.sfx</code> PHP <a href="./manual-build.html#-micro-combine--micro-"> micro </a></li><li>embed: <a href="./manual-build.html#embed-使">embed 使</a></li><li>frankenphp: <code>buildroot/bin/frankenphp</code></li></ul><p>使 <code>--debug</code> 使 <code>--with-clean</code> </p><p>使 issue <code>craft.yml</code> <code>log/</code> </p><h2 id="" tabindex="-1"> <a class="header-anchor" href="#" aria-label="Permalink to "></a></h2><p> PHP 使 <code>bin/spc</code> </p><h3 id="-download-" tabindex="-1"> download - <a class="header-anchor" href="#-download-" aria-label="Permalink to download - "></a></h3><p>使 <code>bin/spc download</code> php-src </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;"># 使</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> download</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --for-extensions=openssl,swoole,zip,pcntl,zstd</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 仅下载要编译的扩展及依赖库使用扩展名不包含可选库</span></span>