deploy: a8a071de1a712f13a2731fa507c5ac8d14d4741b

This commit is contained in:
crazywhalecc 2024-12-01 08:11:44 +00:00
parent 3e7a45c3e4
commit 838ca1211d
47 changed files with 50 additions and 50 deletions

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ import{_ as e,c as i,o as s,a1 as a}from"./chunks/framework.gjrnbxUT.js";const m
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/setup-runtime</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -action</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add-path</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Delete the runtime/ directory in PATH</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/setup-runtime</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -action</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> remove-path</span></span></code></pre></div><h3 id="install-other-tools-automatic" tabindex="-1">Install other Tools (automatic) <a class="header-anchor" href="#install-other-tools-automatic" aria-label="Permalink to &quot;Install other Tools (automatic)&quot;"></a></h3><p>For <code>php-sdk-binary-tools</code>, <code>strawberry-perl</code>, and <code>nasm</code>, we recommend that you directly use the command <code>bin/spc doctor</code> to check and install them.</p><p>If doctor successfully installs automatically, please <strong>skip</strong> the steps below to manually install the above tools.</p><p>But if the automatic installation fails, please refer to the manual installation method below.</p><h3 id="install-php-sdk-binary-tools-manual" tabindex="-1">Install php-sdk-binary-tools (manual) <a class="header-anchor" href="#install-php-sdk-binary-tools-manual" aria-label="Permalink to &quot;Install php-sdk-binary-tools (manual)&quot;"></a></h3><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> C:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\s</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">pc-build</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\s</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">tatic-php-cli</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/setup-runtime</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -action</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> remove-path</span></span></code></pre></div><p>Finally, now that you have PHP and Composer installed, you need to install static-php-cli&#39;s Composer dependencies:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">composer</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span></span></code></pre></div><h3 id="install-other-tools-automatic" tabindex="-1">Install other Tools (automatic) <a class="header-anchor" href="#install-other-tools-automatic" aria-label="Permalink to &quot;Install other Tools (automatic)&quot;"></a></h3><p>For <code>php-sdk-binary-tools</code>, <code>strawberry-perl</code>, and <code>nasm</code>, we recommend that you directly use the command <code>bin/spc doctor</code> to check and install them.</p><p>If doctor successfully installs automatically, please <strong>skip</strong> the steps below to manually install the above tools.</p><p>But if the automatic installation fails, please refer to the manual installation method below.</p><h3 id="install-php-sdk-binary-tools-manual" tabindex="-1">Install php-sdk-binary-tools (manual) <a class="header-anchor" href="#install-php-sdk-binary-tools-manual" aria-label="Permalink to &quot;Install php-sdk-binary-tools (manual)&quot;"></a></h3><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> C:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\s</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">pc-build</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\s</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">tatic-php-cli</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">git</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> clone</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://github.com/php/php-sdk-binary-tools.git</span></span></code></pre></div><blockquote><p>You can also set the global variable <code>PHP_SDK_PATH</code> in Windows settings and clone the project to the path corresponding to the variable. Under normal circumstances, you don&#39;t need to change it.</p></blockquote><h3 id="install-strawberry-perl-manual" tabindex="-1">Install strawberry-perl (manual) <a class="header-anchor" href="#install-strawberry-perl-manual" aria-label="Permalink to &quot;Install strawberry-perl (manual)&quot;"></a></h3><blockquote><p>If you don&#39;t need to compile the openssl extension, you don&#39;t need to install perl.</p></blockquote><ol><li>Download the latest version of strawberry-perl from <a href="https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/" target="_blank" rel="noreferrer">GitHub</a>.</li><li>Install to the <code>C:\\spc-build\\static-php-cli\\pkgroot\\perl\\</code> directory.</li></ol><blockquote><p>You can download the <code>-portable</code> version and extract it directly to the above directory. The last <code>perl.exe</code> should be located at <code>C:\\spc-build\\static-php-cli\\pkgroot\\perl\\perl\\bin\\perl.exe</code>.</p></blockquote><h3 id="install-nasm-manual" tabindex="-1">Install nasm (manual) <a class="header-anchor" href="#install-nasm-manual" aria-label="Permalink to &quot;Install nasm (manual)&quot;"></a></h3><blockquote><p>If you don&#39;t need to compile openssl extension, you don&#39;t need to install nasm.</p></blockquote><ol><li>Download the nasm tool (x64) from <a href="https://www.nasm.us/pub/nasm/releasebuilds/" target="_blank" rel="noreferrer">official website</a>.</li><li>Place <code>nasm.exe</code> and <code>ndisasm.exe</code> in the <code>C:\\spc-build\\static-php-cli\\php-sdk-binary-tools\\bin\\</code> directory.</li></ol><h2 id="download-required-sources" tabindex="-1">Download required sources <a class="header-anchor" href="#download-required-sources" aria-label="Permalink to &quot;Download required sources&quot;"></a></h2><p>Same as <a href="./manual-build.html#command-download">Manual build - Download</a></p><h2 id="build-php" tabindex="-1">Build PHP <a class="header-anchor" href="#build-php" aria-label="Permalink to &quot;Build PHP&quot;"></a></h2><p>Use the build command to start building the static php binary. Before executing the <code>bin/spc build</code> command, be sure to use the <code>download</code> command to download sources. It is recommended to use <code>doctor</code> to check the environment.</p><h3 id="build-sapi" tabindex="-1">Build SAPI <a class="header-anchor" href="#build-sapi" aria-label="Permalink to &quot;Build SAPI&quot;"></a></h3><p>You need to go to <a href="./extensions.html">Extension List</a> or <a href="./cli-generator.html">Command Generator</a> to select the extension you want to add, and then use the command <code>bin/spc build</code> to compile. You need to specify targets, choose from the following parameters (at least one):</p><ul><li><code>--build-cli</code>: Build a cli sapi (command line interface, which can execute PHP code on the command line)</li><li><code>--build-micro</code>: Build a micro sapi (used to build a standalone executable binary containing PHP code)</li></ul><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Compile PHP with bcmath,openssl,zlib extensions, the compilation target is cli</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;bcmath,openssl,zlib&quot;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build-cli</span></span>
<span class="line"></span>
@ -20,4 +20,4 @@ import{_ as e,c as i,o as s,a1 as a}from"./chunks/framework.gjrnbxUT.js";const m
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">my-app.exe</span></span></code></pre></div><h2 id="use-php-exe" tabindex="-1">Use php.exe <a class="header-anchor" href="#use-php-exe" aria-label="Permalink to &quot;Use php.exe&quot;"></a></h2><p>After php.exe is compiled, it is located in the <code>buildroot\\bin\\</code> directory. You can copy it to any location for use.</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">.</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">\\</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">php</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -v</span></span></code></pre></div><h2 id="use-micro-sfx" tabindex="-1">Use micro.sfx <a class="header-anchor" href="#use-micro-sfx" aria-label="Permalink to &quot;Use micro.sfx&quot;"></a></h2><blockquote><p>phpmicro is a SelF-extracted eXecutable SAPI module, provided by <a href="https://github.com/dixyes/phpmicro" target="_blank" rel="noreferrer">phpmicro</a> project. But this project is using a <a href="https://github.com/static-php/phpmicro" target="_blank" rel="noreferrer">fork</a> of phpmicro, because we need to add some features to it. It can put php runtime and your source code together.</p></blockquote><p>The final compilation result will output a file named <code>./micro.sfx</code>, which needs to be used with your PHP source code like <code>code.php</code>. This file will be located in the path <code>buildroot/bin/micro.sfx</code>.</p><p>Prepare your project source code, which can be a single PHP file or a Phar file, for use.</p><blockquote><p>If you want to combine phar files, you must add <code>phar</code> extension when compiling!</p></blockquote><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># code.php &quot;&lt;?php echo &#39;Hello world&#39; . PHP_EOL;&quot;</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bin/spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> micro:combine</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> code.php</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -O</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> my-app.exe</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Run it!!! Copy it to another computer!!!</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./my-app.exe</span></span></code></pre></div><p>If you package a PHAR file, just replace <code>code.php</code> with the phar file path. You can use <a href="https://github.com/box-project/box" target="_blank" rel="noreferrer">box-project/box</a> to package your CLI project as Phar, It is then combined with phpmicro to produce a standalone executable binary.</p><p>For more details on the <code>micro:combine</code> command, refer to <a href="./manual-build.html">command</a> on Unix systems.</p>`,62),l=[o];function n(p,d,h,r,c,u){return s(),i("div",null,l)}const b=e(t,[["render",n]]);export{m as __pageData,b as default};
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./my-app.exe</span></span></code></pre></div><p>If you package a PHAR file, just replace <code>code.php</code> with the phar file path. You can use <a href="https://github.com/box-project/box" target="_blank" rel="noreferrer">box-project/box</a> to package your CLI project as Phar, It is then combined with phpmicro to produce a standalone executable binary.</p><p>For more details on the <code>micro:combine</code> command, refer to <a href="./manual-build.html">command</a> on Unix systems.</p>`,64),l=[o];function n(p,d,h,c,r,u){return s(),i("div",null,l)}const b=e(t,[["render",n]]);export{m as __pageData,b as default};

View File

@ -1 +1 @@
import{_ as e,c as i,o as s,a1 as a}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"Build on Windows","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/build-on-windows.md","filePath":"en/guide/build-on-windows.md"}'),t={name:"en/guide/build-on-windows.md"},o=a("",62),l=[o];function n(p,d,h,r,c,u){return s(),i("div",null,l)}const b=e(t,[["render",n]]);export{m as __pageData,b as default};
import{_ as e,c as i,o as s,a1 as a}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"Build on Windows","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/build-on-windows.md","filePath":"en/guide/build-on-windows.md"}'),t={name:"en/guide/build-on-windows.md"},o=a("",64),l=[o];function n(p,d,h,c,r,u){return s(),i("div",null,l)}const b=e(t,[["render",n]]);export{m as __pageData,b as default};

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

View File

@ -1 +1 @@
{"en_contributing_index.md":"CsY8mx8F","en_guide_action-build.md":"BKamBazh","deps-map-lib.md":"BKtXgOTT","extensions.md":"DNwc8Rjt","en_guide_deps-map.md":"9BjfenQS","extension-notes.md":"Bw8xYOie","zh_contributing_index.md":"BvgdahxO","zh_develop_php-src-changes.md":"Df0-NcBw","en_develop_system-build-tools.md":"D6vaAwN3","en_guide_extension-notes.md":"BaBSDnpT","zh_develop_index.md":"-CPpDfMx","zh_guide_index.md":"20ged7P4","zh_develop_structure.md":"B-0RMSSw","zh_guide_action-build.md":"DWMlBDvT","zh_guide_cli-generator.md":"Cd4XDgQE","deps-map-ext.md":"Dm1vf8Tb","zh_guide_build-on-windows.md":"BxVEYT8r","en_develop_doctor-module.md":"DGd8PeM_","zh_guide_extensions.md":"1LGh8oE2","zh_guide_extension-notes.md":"Bk8p1Uuk","zh_guide_env-vars.md":"CfYA93uA","zh_guide_deps-map.md":"CDLAslHS","en_guide_manual-build.md":"BF0Q0syR","en_guide_troubleshooting.md":"BC56sVyT","en_guide_index.md":"CjOUKFgy","en_guide_extensions.md":"Bdy-VEVA","zh_develop_doctor-module.md":"DgFAPT6E","index.md":"mKXtywCA","en_guide_build-on-windows.md":"DfGh0GYv","zh_develop_system-build-tools.md":"Ds53VEw1","en_develop_php-src-changes.md":"DLlooohw","en_faq_index.md":"DLWPz-7S","zh_develop_source-module.md":"D0odLsHX","zh_faq_index.md":"DL8Ncj95","en_develop_index.md":"B7_c9YYa","en_guide_cli-generator.md":"BybVouc3","en_guide_env-vars.md":"DXDG6yvH","en_develop_source-module.md":"CdOHR0ez","zh_guide_manual-build.md":"BbIO7lI2","zh_index.md":"LslJ1UMp","en_index.md":"Cbpb4iAg","en_develop_structure.md":"BA5PDIse","zh_guide_troubleshooting.md":"Da-RmPO_"}
{"en_guide_cli-generator.md":"BybVouc3","en_develop_php-src-changes.md":"DLlooohw","zh_guide_index.md":"20ged7P4","en_develop_structure.md":"BA5PDIse","zh_index.md":"LslJ1UMp","zh_guide_troubleshooting.md":"Da-RmPO_","extension-notes.md":"Bw8xYOie","extensions.md":"DNwc8Rjt","deps-map-ext.md":"Dm1vf8Tb","index.md":"mKXtywCA","en_index.md":"Cbpb4iAg","zh_develop_index.md":"-CPpDfMx","zh_guide_action-build.md":"DWMlBDvT","en_guide_manual-build.md":"BF0Q0syR","zh_develop_structure.md":"B-0RMSSw","zh_guide_manual-build.md":"BbIO7lI2","en_guide_extension-notes.md":"BaBSDnpT","en_guide_action-build.md":"BKamBazh","en_guide_extensions.md":"Bdy-VEVA","en_develop_system-build-tools.md":"D6vaAwN3","en_develop_doctor-module.md":"DGd8PeM_","zh_guide_build-on-windows.md":"BxVEYT8r","en_guide_deps-map.md":"9BjfenQS","en_develop_source-module.md":"CdOHR0ez","zh_faq_index.md":"DL8Ncj95","zh_develop_source-module.md":"D0odLsHX","zh_develop_system-build-tools.md":"Ds53VEw1","en_guide_env-vars.md":"DXDG6yvH","en_contributing_index.md":"CsY8mx8F","en_guide_troubleshooting.md":"BC56sVyT","en_faq_index.md":"DLWPz-7S","zh_contributing_index.md":"BvgdahxO","zh_guide_extensions.md":"1LGh8oE2","zh_guide_cli-generator.md":"Cd4XDgQE","zh_develop_doctor-module.md":"DgFAPT6E","en_develop_index.md":"B7_c9YYa","zh_develop_php-src-changes.md":"Df0-NcBw","en_guide_build-on-windows.md":"0XosmiyO","zh_guide_env-vars.md":"CfYA93uA","deps-map-lib.md":"BKtXgOTT","en_guide_index.md":"CjOUKFgy","zh_guide_extension-notes.md":"Bk8p1Uuk","zh_guide_deps-map.md":"CDLAslHS"}

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