mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
deploy: afd67910750dde1346d7ab33675c1bca9c12a6a0
This commit is contained in:
parent
63e3c6df8c
commit
9b9b6c3cbf
@ -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>
|
||||
@ -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>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
{"deps-craft-yml.md":"DWPKeuXi","deps-map-ext.md":"DUyTm_Hg","deps-map-lib.md":"DOtBR8NX","en_contributing_index.md":"C8tXDL1f","en_develop_craft-yml.md":"BDq8uWIr","en_develop_doctor-module.md":"DYVfKght","en_develop_index.md":"DSlquryN","en_develop_php-src-changes.md":"DadHFaGC","en_develop_source-module.md":"CeJEgS_j","en_develop_structure.md":"D1kBTweh","en_develop_system-build-tools.md":"DK4AaCy_","en_faq_index.md":"DnHLgGcl","en_guide_action-build.md":"BCJvLz8l","en_guide_build-on-windows.md":"CG23CkLK","en_guide_build-with-glibc.md":"BDBCsGWa","en_guide_cli-generator.md":"DxnnSLf6","en_guide_deps-map.md":"CpWEZHIz","en_guide_env-vars.md":"DzVATbtO","en_guide_extension-notes.md":"qcRlR4zd","en_guide_extensions.md":"mwwn3I1N","en_guide_index.md":"By6XUN6E","en_guide_manual-build.md":"szvbN8j_","en_guide_troubleshooting.md":"BvJgQKvb","en_index.md":"kO-e39M0","extension-notes.md":"DkpYDq7p","extensions.md":"I66dgmMR","index.md":"wJBxKTzp","zh_contributing_index.md":"22akXfoC","zh_develop_craft-yml.md":"Dfv1fXuq","zh_develop_doctor-module.md":"B8r2lbU8","zh_develop_index.md":"DecU9Y3b","zh_develop_php-src-changes.md":"CkjaMIky","zh_develop_source-module.md":"DoBnezP5","zh_develop_structure.md":"DStJTsYD","zh_develop_system-build-tools.md":"CxPkPV_h","zh_faq_index.md":"nE1d0aPt","zh_guide_action-build.md":"CYeVjGhJ","zh_guide_build-on-windows.md":"6JBREABQ","zh_guide_build-with-glibc.md":"CGbU937o","zh_guide_cli-generator.md":"DzQ7ESw0","zh_guide_deps-map.md":"BtnTeTE6","zh_guide_env-vars.md":"DqYHbUfS","zh_guide_extension-notes.md":"BkfCboVT","zh_guide_extensions.md":"DhhRyH8e","zh_guide_index.md":"DWAO4_zO","zh_guide_manual-build.md":"CBjxVwQN","zh_guide_troubleshooting.md":"DSUIb51x","zh_index.md":"DcikGFee"}
|
||||
{"deps-craft-yml.md":"DWPKeuXi","deps-map-ext.md":"DUyTm_Hg","deps-map-lib.md":"DOtBR8NX","en_contributing_index.md":"C8tXDL1f","en_develop_craft-yml.md":"BDq8uWIr","en_develop_doctor-module.md":"DYVfKght","en_develop_index.md":"DSlquryN","en_develop_php-src-changes.md":"DadHFaGC","en_develop_source-module.md":"CeJEgS_j","en_develop_structure.md":"D1kBTweh","en_develop_system-build-tools.md":"DK4AaCy_","en_faq_index.md":"DnHLgGcl","en_guide_action-build.md":"BCJvLz8l","en_guide_build-on-windows.md":"CG23CkLK","en_guide_build-with-glibc.md":"BDBCsGWa","en_guide_cli-generator.md":"DxnnSLf6","en_guide_deps-map.md":"CpWEZHIz","en_guide_env-vars.md":"DzVATbtO","en_guide_extension-notes.md":"qcRlR4zd","en_guide_extensions.md":"mwwn3I1N","en_guide_index.md":"By6XUN6E","en_guide_manual-build.md":"BS1NEyZX","en_guide_troubleshooting.md":"BvJgQKvb","en_index.md":"kO-e39M0","extension-notes.md":"DkpYDq7p","extensions.md":"I66dgmMR","index.md":"wJBxKTzp","zh_contributing_index.md":"22akXfoC","zh_develop_craft-yml.md":"Dfv1fXuq","zh_develop_doctor-module.md":"B8r2lbU8","zh_develop_index.md":"DecU9Y3b","zh_develop_php-src-changes.md":"CkjaMIky","zh_develop_source-module.md":"DoBnezP5","zh_develop_structure.md":"DStJTsYD","zh_develop_system-build-tools.md":"CxPkPV_h","zh_faq_index.md":"nE1d0aPt","zh_guide_action-build.md":"CYeVjGhJ","zh_guide_build-on-windows.md":"6JBREABQ","zh_guide_build-with-glibc.md":"CGbU937o","zh_guide_cli-generator.md":"DzQ7ESw0","zh_guide_deps-map.md":"BtnTeTE6","zh_guide_env-vars.md":"DqYHbUfS","zh_guide_extension-notes.md":"BkfCboVT","zh_guide_extensions.md":"DhhRyH8e","zh_guide_index.md":"DWAO4_zO","zh_guide_manual-build.md":"DAnA1dt8","zh_guide_troubleshooting.md":"DSUIb51x","zh_index.md":"DcikGFee"}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user