deploy: ca8ec70c407507102b7565df6918791736c0ba07

This commit is contained in:
crazywhalecc 2024-10-05 07:34:40 +00:00
parent 3d48cf2189
commit 0b43cc96d4
145 changed files with 363 additions and 360 deletions

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{U as o,a7 as p,a8 as u,a9 as l,aa as c,ab as f,ac as d,ad as m,ae as h,af as g,ag as A,d as P,u as v,y,x as w,ah as C,ai as R,aj as b,ak as E}from"./chunks/framework.CszIUXhs.js";import{R as S}from"./chunks/theme.Yd2LEGgK.js";function i(e){if(e.extends){const a=i(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const s=i(S),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=v();return y(()=>{w(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),R(),b(),s.setup&&s.setup(),()=>E(s.Layout)}});async function _(){globalThis.__VITEPRESS__=!0;const e=x(),a=j();a.provide(u,e);const t=l(e.route);return a.provide(c,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),s.enhanceApp&&await s.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function j(){return h(T)}function x(){let e=o,a;return g(t=>{let n=A(t),r=null;return n&&(e&&(a=n),(e||a===n)&&(n=n.replace(/\.js$/,".lean.js")),r=import(n)),o&&(e=!1),r},s.NotFound)}o&&_().then(({app:e,router:a,data:t})=>{a.go().then(()=>{p(a.route,t.site),e.mount("#app")})});export{_ as createApp};
import{U as o,a7 as p,a8 as u,a9 as l,aa as c,ab as f,ac as d,ad as m,ae as h,af as g,ag as A,d as P,u as v,y,x as w,ah as C,ai as R,aj as b,ak as E}from"./chunks/framework.gjrnbxUT.js";import{R as S}from"./chunks/theme.5IQMzWyn.js";function i(e){if(e.extends){const a=i(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const s=i(S),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=v();return y(()=>{w(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),R(),b(),s.setup&&s.setup(),()=>E(s.Layout)}});async function _(){globalThis.__VITEPRESS__=!0;const e=x(),a=j();a.provide(u,e);const t=l(e.route);return a.provide(c,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),s.enhanceApp&&await s.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function j(){return h(T)}function x(){let e=o,a;return g(t=>{let n=A(t),r=null;return n&&(e&&(a=n),(e||a===n)&&(n=n.replace(/\.js$/,".lean.js")),r=import(n)),o&&(e=!1),r},s.NotFound)}o&&_().then(({app:e,router:a,data:t})=>{a.go().then(()=>{p(a.route,t.site),e.mount("#app")})});export{_ as createApp};

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 @@
import{_ as t,c as d,o as b,a1 as r}from"./chunks/framework.CszIUXhs.js";const x=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-map-ext.md","filePath":"deps-map-ext.md"}'),l={name:"deps-map-ext.md"},s=r("",8),i=[s];function e(o,a,p,n,m,h){return b(),d("div",null,i)}const g=t(l,[["render",e]]);export{x as __pageData,g as default};
import{_ as t,c as d,o as b,a1 as r}from"./chunks/framework.gjrnbxUT.js";const x=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-map-ext.md","filePath":"deps-map-ext.md"}'),l={name:"deps-map-ext.md"},s=r("",8),i=[s];function e(o,a,p,n,m,h){return b(),d("div",null,i)}const g=t(l,[["render",e]]);export{x as __pageData,g as default};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{_ as t,c as d,o as b,a1 as r}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-map-lib.md","filePath":"deps-map-lib.md"}'),i={name:"deps-map-lib.md"},l=r("",8),e=[l];function s(a,n,o,p,h,z){return b(),d("div",null,e)}const x=t(i,[["render",s]]);export{m as __pageData,x as default};
import{_ as t,c as d,o as b,a1 as r}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"deps-map-lib.md","filePath":"deps-map-lib.md"}'),i={name:"deps-map-lib.md"},l=r("",8),e=[l];function s(a,n,o,p,h,z){return b(),d("div",null,e)}const x=t(i,[["render",s]]);export{m as __pageData,x as default};

View File

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

View File

@ -1,4 +1,4 @@
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"Doctor module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/doctor-module.md","filePath":"en/develop/doctor-module.md"}'),t={name:"en/develop/doctor-module.md"},h=e(`<h1 id="doctor-module" tabindex="-1">Doctor module <a class="header-anchor" href="#doctor-module" aria-label="Permalink to &quot;Doctor module&quot;"></a></h1><p>The Doctor module is a relatively independent module used to check the system environment, which can be entered with the command <code>bin/spc doctor</code>, and the entry command class is in <code>DoctorCommand.php</code>.</p><p>The Doctor module is a checklist with a series of check items and automatic repair items. These items are stored in the <code>src/SPC/doctor/item/</code> directory, And two Attributes are used as check item tags and auto-fix item tags: <code>#[AsCheckItem]</code> and <code>#[AsFixItem]</code>.</p><p>Take the existing check item <code>if necessary tools are installed</code>, which is used to check whether the packages necessary for compilation are installed in the macOS system. The following is its source code:</p><div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> SPC\\doctor\\AsCheckItem</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"Doctor module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/doctor-module.md","filePath":"en/develop/doctor-module.md"}'),t={name:"en/develop/doctor-module.md"},h=e(`<h1 id="doctor-module" tabindex="-1">Doctor module <a class="header-anchor" href="#doctor-module" aria-label="Permalink to &quot;Doctor module&quot;"></a></h1><p>The Doctor module is a relatively independent module used to check the system environment, which can be entered with the command <code>bin/spc doctor</code>, and the entry command class is in <code>DoctorCommand.php</code>.</p><p>The Doctor module is a checklist with a series of check items and automatic repair items. These items are stored in the <code>src/SPC/doctor/item/</code> directory, And two Attributes are used as check item tags and auto-fix item tags: <code>#[AsCheckItem]</code> and <code>#[AsFixItem]</code>.</p><p>Take the existing check item <code>if necessary tools are installed</code>, which is used to check whether the packages necessary for compilation are installed in the macOS system. The following is its source code:</p><div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> SPC\\doctor\\AsCheckItem</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> SPC\\doctor\\AsFixItem</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> SPC\\doctor\\CheckResult</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"></span>

View File

@ -1 +1 @@
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"Doctor module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/doctor-module.md","filePath":"en/develop/doctor-module.md"}'),t={name:"en/develop/doctor-module.md"},h=e("",13),n=[h];function l(k,p,r,d,o,c){return a(),i("div",null,n)}const y=s(t,[["render",l]]);export{g as __pageData,y as default};
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"Doctor module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/doctor-module.md","filePath":"en/develop/doctor-module.md"}'),t={name:"en/develop/doctor-module.md"},h=e("",13),n=[h];function l(k,p,r,d,o,c){return a(),i("div",null,n)}const y=s(t,[["render",l]]);export{g as __pageData,y as default};

View File

@ -1 +1 @@
import{_ as e,c as t,o,a1 as n}from"./chunks/framework.CszIUXhs.js";const v=JSON.parse('{"title":"Start Developing","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/index.md","filePath":"en/develop/index.md"}'),i={name:"en/develop/index.md"},s=n('<h1 id="start-developing" tabindex="-1">Start Developing <a class="header-anchor" href="#start-developing" aria-label="Permalink to &quot;Start Developing&quot;"></a></h1><p>Developing this project requires the installation and deployment of a PHP environment, as well as some extensions and Composer commonly used in PHP projects.</p><p>The development environment and running environment of the project are almost exactly the same. You can refer to the <strong>Manual Build</strong> section to install system PHP or use the pre-built static PHP of this project as the environment. I will not go into details here.</p><p>Regardless of its purpose, this project itself is actually a <code>php-cli</code> program. You can edit and develop it as a normal PHP project. At the same time, you need to understand the Shell languages of different systems.</p><p>The current purpose of this project is to compile statically compiled independent PHP, but the main part also includes compiling static versions of many dependent libraries, so you can reuse this set of compilation logic to build independent binary versions of other programs, such as Nginx, etc.</p><h2 id="environment-preparation" tabindex="-1">Environment preparation <a class="header-anchor" href="#environment-preparation" aria-label="Permalink to &quot;Environment preparation&quot;"></a></h2><p>A PHP environment is required to develop this project. You can use the PHP that comes with the system, or you can use the static PHP built by this project.</p><p>Regardless of which PHP you use, in your development environment you need to install these extensions:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter</span></span></code></pre></div><p>The static-php-cli project itself does not require so many extensions, but during the development process, you will use tools such as Composer and PHPUnit, which require these extensions.</p><blockquote><p>For micro self-executing binaries built by static-php-cli itself, only <code>pcntl,posix,mbstring,tokenizer,phar</code> is required.</p></blockquote><h2 id="start-development" tabindex="-1">Start development <a class="header-anchor" href="#start-development" aria-label="Permalink to &quot;Start development&quot;"></a></h2><p>Continuing down to see the project structure documentation, you can learn how <code>static-php-cli</code> works.</p>',13),a=[s];function r(p,l,c,d,h,u){return o(),t("div",null,a)}const g=e(i,[["render",r]]);export{v as __pageData,g as default};
import{_ as e,c as t,o,a1 as n}from"./chunks/framework.gjrnbxUT.js";const v=JSON.parse('{"title":"Start Developing","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/index.md","filePath":"en/develop/index.md"}'),i={name:"en/develop/index.md"},s=n('<h1 id="start-developing" tabindex="-1">Start Developing <a class="header-anchor" href="#start-developing" aria-label="Permalink to &quot;Start Developing&quot;"></a></h1><p>Developing this project requires the installation and deployment of a PHP environment, as well as some extensions and Composer commonly used in PHP projects.</p><p>The development environment and running environment of the project are almost exactly the same. You can refer to the <strong>Manual Build</strong> section to install system PHP or use the pre-built static PHP of this project as the environment. I will not go into details here.</p><p>Regardless of its purpose, this project itself is actually a <code>php-cli</code> program. You can edit and develop it as a normal PHP project. At the same time, you need to understand the Shell languages of different systems.</p><p>The current purpose of this project is to compile statically compiled independent PHP, but the main part also includes compiling static versions of many dependent libraries, so you can reuse this set of compilation logic to build independent binary versions of other programs, such as Nginx, etc.</p><h2 id="environment-preparation" tabindex="-1">Environment preparation <a class="header-anchor" href="#environment-preparation" aria-label="Permalink to &quot;Environment preparation&quot;"></a></h2><p>A PHP environment is required to develop this project. You can use the PHP that comes with the system, or you can use the static PHP built by this project.</p><p>Regardless of which PHP you use, in your development environment you need to install these extensions:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter</span></span></code></pre></div><p>The static-php-cli project itself does not require so many extensions, but during the development process, you will use tools such as Composer and PHPUnit, which require these extensions.</p><blockquote><p>For micro self-executing binaries built by static-php-cli itself, only <code>pcntl,posix,mbstring,tokenizer,phar</code> is required.</p></blockquote><h2 id="start-development" tabindex="-1">Start development <a class="header-anchor" href="#start-development" aria-label="Permalink to &quot;Start development&quot;"></a></h2><p>Continuing down to see the project structure documentation, you can learn how <code>static-php-cli</code> works.</p>',13),a=[s];function r(p,l,c,d,h,u){return o(),t("div",null,a)}const g=e(i,[["render",r]]);export{v as __pageData,g as default};

View File

@ -1 +1 @@
import{_ as e,c as t,o,a1 as n}from"./chunks/framework.CszIUXhs.js";const v=JSON.parse('{"title":"Start Developing","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/index.md","filePath":"en/develop/index.md"}'),i={name:"en/develop/index.md"},s=n("",13),a=[s];function r(p,l,c,d,h,u){return o(),t("div",null,a)}const g=e(i,[["render",r]]);export{v as __pageData,g as default};
import{_ as e,c as t,o,a1 as n}from"./chunks/framework.gjrnbxUT.js";const v=JSON.parse('{"title":"Start Developing","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/index.md","filePath":"en/develop/index.md"}'),i={name:"en/develop/index.md"},s=n("",13),a=[s];function r(p,l,c,d,h,u){return o(),t("div",null,a)}const g=e(i,[["render",r]]);export{v as __pageData,g as default};

View File

@ -1 +1 @@
import{_ as e,c as i,o as t,a1 as o}from"./chunks/framework.CszIUXhs.js";const f=JSON.parse('{"title":"Modifications to PHP source code","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/php-src-changes.md","filePath":"en/develop/php-src-changes.md"}'),a={name:"en/develop/php-src-changes.md"},s=o('<h1 id="modifications-to-php-source-code" tabindex="-1">Modifications to PHP source code <a class="header-anchor" href="#modifications-to-php-source-code" aria-label="Permalink to &quot;Modifications to PHP source code&quot;"></a></h1><p>During the static compilation process, static-php-cli made some modifications to the PHP source code in order to achieve good compatibility, performance, and security. The following is a description of the current modifications to the PHP source code.</p><h2 id="micro-related-patches" tabindex="-1">Micro related patches <a class="header-anchor" href="#micro-related-patches" aria-label="Permalink to &quot;Micro related patches&quot;"></a></h2><p>Based on the patches provided by the phpmicro project, static-php-cli has made some modifications to the PHP source code to meet the needs of static compilation. The patches currently used by static-php-cli during compilation in the <a href="https://github.com/easysoft/phpmicro/tree/master/patches" target="_blank" rel="noreferrer">patch list</a> are:</p><ul><li>static_opcache</li><li>static_extensions_win32</li><li>cli_checks</li><li>disable_huge_page</li><li>vcruntime140</li><li>win32</li><li>zend_stream</li><li>cli_static</li><li>macos_iconv</li><li>phar</li></ul><h2 id="php-8-1-libxml-patch" tabindex="-1">PHP &lt;= 8.1 libxml patch <a class="header-anchor" href="#php-8-1-libxml-patch" aria-label="Permalink to &quot;PHP &lt;= 8.1 libxml patch&quot;"></a></h2><p>Because PHP only provides security updates for 8.1 and stops updating older versions, static-php-cli applies the libxml compilation patch that has been applied in newer versions of PHP to PHP 8.1 and below.</p><h2 id="gd-extension-windows-patch" tabindex="-1">gd extension Windows patch <a class="header-anchor" href="#gd-extension-windows-patch" aria-label="Permalink to &quot;gd extension Windows patch&quot;"></a></h2><p>Compiling the gd extension under Windows requires major changes to the <code>config.w32</code> file. static-php-cli has made some changes to the gd extension to make it easier to compile under Windows.</p><h2 id="yaml-extension-windows-patch" tabindex="-1">YAML extension Windows patch <a class="header-anchor" href="#yaml-extension-windows-patch" aria-label="Permalink to &quot;YAML extension Windows patch&quot;"></a></h2><p>YAML extension needs to modify the <code>config.w32</code> file to compile under Windows. static-php-cli has made some modifications to the YAML extension to make it easier to compile under Windows.</p><h2 id="static-php-cli-version-information-insertion" tabindex="-1">static-php-cli version information insertion <a class="header-anchor" href="#static-php-cli-version-information-insertion" aria-label="Permalink to &quot;static-php-cli version information insertion&quot;"></a></h2><p>When compiling, static-php-cli will insert the static-php-cli version information into the PHP version information for easy identification.</p><h2 id="add-option-to-hardcode-ini" tabindex="-1">Add option to hardcode INI <a class="header-anchor" href="#add-option-to-hardcode-ini" aria-label="Permalink to &quot;Add option to hardcode INI&quot;"></a></h2><p>When using the <code>-I</code> parameter to hardcode INI into static PHP functionality, static-php-cli will modify the PHP source code to insert the hardcoded content.</p><h2 id="linux-system-repair-patch" tabindex="-1">Linux system repair patch <a class="header-anchor" href="#linux-system-repair-patch" aria-label="Permalink to &quot;Linux system repair patch&quot;"></a></h2><p>Some compilation environments may lack some system header files or libraries. static-php-cli will automatically fix these problems during compilation, such as:</p><ul><li>HAVE_STRLCAT missing problem</li><li>HAVE_STRLCPY missing problem</li></ul><h2 id="fiber-issue-fix-patch-for-windows" tabindex="-1">Fiber issue fix patch for Windows <a class="header-anchor" href="#fiber-issue-fix-patch-for-windows" aria-label="Permalink to &quot;Fiber issue fix patch for Windows&quot;"></a></h2><p>When compiling PHP on Windows, there will be some issues with the Fiber extension. static-php-cli will automatically fix these issues during compilation (modify <code>config.w32</code> in php-src).</p>',20),n=[s];function c(r,h,l,p,d,m){return t(),i("div",null,n)}const P=e(a,[["render",c]]);export{f as __pageData,P as default};
import{_ as e,c as i,o as t,a1 as o}from"./chunks/framework.gjrnbxUT.js";const f=JSON.parse('{"title":"Modifications to PHP source code","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/php-src-changes.md","filePath":"en/develop/php-src-changes.md"}'),a={name:"en/develop/php-src-changes.md"},s=o('<h1 id="modifications-to-php-source-code" tabindex="-1">Modifications to PHP source code <a class="header-anchor" href="#modifications-to-php-source-code" aria-label="Permalink to &quot;Modifications to PHP source code&quot;"></a></h1><p>During the static compilation process, static-php-cli made some modifications to the PHP source code in order to achieve good compatibility, performance, and security. The following is a description of the current modifications to the PHP source code.</p><h2 id="micro-related-patches" tabindex="-1">Micro related patches <a class="header-anchor" href="#micro-related-patches" aria-label="Permalink to &quot;Micro related patches&quot;"></a></h2><p>Based on the patches provided by the phpmicro project, static-php-cli has made some modifications to the PHP source code to meet the needs of static compilation. The patches currently used by static-php-cli during compilation in the <a href="https://github.com/easysoft/phpmicro/tree/master/patches" target="_blank" rel="noreferrer">patch list</a> are:</p><ul><li>static_opcache</li><li>static_extensions_win32</li><li>cli_checks</li><li>disable_huge_page</li><li>vcruntime140</li><li>win32</li><li>zend_stream</li><li>cli_static</li><li>macos_iconv</li><li>phar</li></ul><h2 id="php-8-1-libxml-patch" tabindex="-1">PHP &lt;= 8.1 libxml patch <a class="header-anchor" href="#php-8-1-libxml-patch" aria-label="Permalink to &quot;PHP &lt;= 8.1 libxml patch&quot;"></a></h2><p>Because PHP only provides security updates for 8.1 and stops updating older versions, static-php-cli applies the libxml compilation patch that has been applied in newer versions of PHP to PHP 8.1 and below.</p><h2 id="gd-extension-windows-patch" tabindex="-1">gd extension Windows patch <a class="header-anchor" href="#gd-extension-windows-patch" aria-label="Permalink to &quot;gd extension Windows patch&quot;"></a></h2><p>Compiling the gd extension under Windows requires major changes to the <code>config.w32</code> file. static-php-cli has made some changes to the gd extension to make it easier to compile under Windows.</p><h2 id="yaml-extension-windows-patch" tabindex="-1">YAML extension Windows patch <a class="header-anchor" href="#yaml-extension-windows-patch" aria-label="Permalink to &quot;YAML extension Windows patch&quot;"></a></h2><p>YAML extension needs to modify the <code>config.w32</code> file to compile under Windows. static-php-cli has made some modifications to the YAML extension to make it easier to compile under Windows.</p><h2 id="static-php-cli-version-information-insertion" tabindex="-1">static-php-cli version information insertion <a class="header-anchor" href="#static-php-cli-version-information-insertion" aria-label="Permalink to &quot;static-php-cli version information insertion&quot;"></a></h2><p>When compiling, static-php-cli will insert the static-php-cli version information into the PHP version information for easy identification.</p><h2 id="add-option-to-hardcode-ini" tabindex="-1">Add option to hardcode INI <a class="header-anchor" href="#add-option-to-hardcode-ini" aria-label="Permalink to &quot;Add option to hardcode INI&quot;"></a></h2><p>When using the <code>-I</code> parameter to hardcode INI into static PHP functionality, static-php-cli will modify the PHP source code to insert the hardcoded content.</p><h2 id="linux-system-repair-patch" tabindex="-1">Linux system repair patch <a class="header-anchor" href="#linux-system-repair-patch" aria-label="Permalink to &quot;Linux system repair patch&quot;"></a></h2><p>Some compilation environments may lack some system header files or libraries. static-php-cli will automatically fix these problems during compilation, such as:</p><ul><li>HAVE_STRLCAT missing problem</li><li>HAVE_STRLCPY missing problem</li></ul><h2 id="fiber-issue-fix-patch-for-windows" tabindex="-1">Fiber issue fix patch for Windows <a class="header-anchor" href="#fiber-issue-fix-patch-for-windows" aria-label="Permalink to &quot;Fiber issue fix patch for Windows&quot;"></a></h2><p>When compiling PHP on Windows, there will be some issues with the Fiber extension. static-php-cli will automatically fix these issues during compilation (modify <code>config.w32</code> in php-src).</p>',20),n=[s];function c(r,h,l,p,d,m){return t(),i("div",null,n)}const P=e(a,[["render",c]]);export{f as __pageData,P as default};

View File

@ -1 +1 @@
import{_ as e,c as i,o as t,a1 as o}from"./chunks/framework.CszIUXhs.js";const f=JSON.parse('{"title":"Modifications to PHP source code","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/php-src-changes.md","filePath":"en/develop/php-src-changes.md"}'),a={name:"en/develop/php-src-changes.md"},s=o("",20),n=[s];function c(r,h,l,p,d,m){return t(),i("div",null,n)}const P=e(a,[["render",c]]);export{f as __pageData,P as default};
import{_ as e,c as i,o as t,a1 as o}from"./chunks/framework.gjrnbxUT.js";const f=JSON.parse('{"title":"Modifications to PHP source code","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/php-src-changes.md","filePath":"en/develop/php-src-changes.md"}'),a={name:"en/develop/php-src-changes.md"},s=o("",20),n=[s];function c(r,h,l,p,d,m){return t(),i("div",null,n)}const P=e(a,[["render",c]]);export{f as __pageData,P as default};

View File

@ -1,4 +1,4 @@
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"Source module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/source-module.md","filePath":"en/develop/source-module.md"}'),t={name:"en/develop/source-module.md"},n=e(`<h1 id="source-module" tabindex="-1">Source module <a class="header-anchor" href="#source-module" aria-label="Permalink to &quot;Source module&quot;"></a></h1><p>The download source module of static-php-cli is a major module. It includes dependent libraries, external extensions, PHP source code download methods and file decompression methods. The download configuration file mainly involves the <code>source.json</code> and <code>pkg.json</code> file, which records the download method of all downloadable sources.</p><p>The main commands involved in the download function are <code>bin/spc download</code> and <code>bin/spc extract</code>. The <code>download</code> command is a downloader that downloads sources according to the configuration file, and the <code>extract</code> command is an extractor that extract sources from downloaded files.</p><p>Generally speaking, downloading sources may be slow because these sources come from various official websites, GitHub, and other different locations. At the same time, they also occupy a large space, so you can download the sources once and reuse them.</p><p>The configuration file of the downloader is <code>source.json</code>, which contains the download methods of all sources. You can add the source download methods you need, or modify the existing source download methods.</p><p>The download configuration structure of each source is as follows. The following is the source download configuration corresponding to the <code>libevent</code> extension:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"Source module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/source-module.md","filePath":"en/develop/source-module.md"}'),t={name:"en/develop/source-module.md"},n=e(`<h1 id="source-module" tabindex="-1">Source module <a class="header-anchor" href="#source-module" aria-label="Permalink to &quot;Source module&quot;"></a></h1><p>The download source module of static-php-cli is a major module. It includes dependent libraries, external extensions, PHP source code download methods and file decompression methods. The download configuration file mainly involves the <code>source.json</code> and <code>pkg.json</code> file, which records the download method of all downloadable sources.</p><p>The main commands involved in the download function are <code>bin/spc download</code> and <code>bin/spc extract</code>. The <code>download</code> command is a downloader that downloads sources according to the configuration file, and the <code>extract</code> command is an extractor that extract sources from downloaded files.</p><p>Generally speaking, downloading sources may be slow because these sources come from various official websites, GitHub, and other different locations. At the same time, they also occupy a large space, so you can download the sources once and reuse them.</p><p>The configuration file of the downloader is <code>source.json</code>, which contains the download methods of all sources. You can add the source download methods you need, or modify the existing source download methods.</p><p>The download configuration structure of each source is as follows. The following is the source download configuration corresponding to the <code>libevent</code> extension:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;libevent&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;type&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;ghrel&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;repo&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;libevent/libevent&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>

View File

@ -1 +1 @@
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"Source module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/source-module.md","filePath":"en/develop/source-module.md"}'),t={name:"en/develop/source-module.md"},n=e("",75),l=[n];function h(p,o,k,d,r,E){return a(),i("div",null,l)}const g=s(t,[["render",h]]);export{u as __pageData,g as default};
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"Source module","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/source-module.md","filePath":"en/develop/source-module.md"}'),t={name:"en/develop/source-module.md"},n=e("",75),l=[n];function h(p,o,k,d,r,E){return a(),i("div",null,l)}const g=s(t,[["render",h]]);export{u as __pageData,g as default};

View File

@ -1 +1 @@
import{_ as e,c as o,o as t,a1 as c}from"./chunks/framework.CszIUXhs.js";const y=JSON.parse('{"title":"Introduction to project structure","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/structure.md","filePath":"en/develop/structure.md"}'),d={name:"en/develop/structure.md"},a=c("",50),r=[a];function i(s,n,p,l,h,m){return t(),o("div",null,r)}const b=e(d,[["render",i]]);export{y as __pageData,b as default};
import{_ as e,c as o,o as t,a1 as c}from"./chunks/framework.gjrnbxUT.js";const y=JSON.parse('{"title":"Introduction to project structure","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/structure.md","filePath":"en/develop/structure.md"}'),d={name:"en/develop/structure.md"},a=c("",50),r=[a];function i(s,n,p,l,h,m){return t(),o("div",null,r)}const b=e(d,[["render",i]]);export{y as __pageData,b as default};

View File

@ -1 +1 @@
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"Compilation Tools","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/system-build-tools.md","filePath":"en/develop/system-build-tools.md"}'),n={name:"en/develop/system-build-tools.md"},t=e("",50),l=[t];function o(p,h,c,r,k,d){return a(),i("div",null,l)}const E=s(n,[["render",o]]);export{g as __pageData,E as default};
import{_ as s,c as i,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"Compilation Tools","description":"","frontmatter":{},"headers":[],"relativePath":"en/develop/system-build-tools.md","filePath":"en/develop/system-build-tools.md"}'),n={name:"en/develop/system-build-tools.md"},t=e("",50),l=[t];function o(p,h,c,r,k,d){return a(),i("div",null,l)}const E=s(n,[["render",o]]);export{g as __pageData,E as default};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{_ as e,c as o,o as t,a1 as i}from"./chunks/framework.CszIUXhs.js";const f=JSON.parse('{"title":"FAQ","description":"","frontmatter":{},"headers":[],"relativePath":"en/faq/index.md","filePath":"en/faq/index.md"}'),a={name:"en/faq/index.md"},s=i("",24),n=[s];function r(c,l,d,p,h,u){return t(),o("div",null,n)}const y=e(a,[["render",r]]);export{f as __pageData,y as default};
import{_ as e,c as o,o as t,a1 as i}from"./chunks/framework.gjrnbxUT.js";const f=JSON.parse('{"title":"FAQ","description":"","frontmatter":{},"headers":[],"relativePath":"en/faq/index.md","filePath":"en/faq/index.md"}'),a={name:"en/faq/index.md"},s=i("",24),n=[s];function r(c,l,d,p,h,u){return t(),o("div",null,n)}const y=e(a,[["render",r]]);export{f as __pageData,y as default};

View File

@ -1 +1 @@
import{_ as e,c as t,o,a1 as i}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"GitHub Action Build","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/action-build.md","filePath":"en/guide/action-build.md"}'),n={name:"en/guide/action-build.md"},a=i('<h1 id="github-action-build" tabindex="-1">GitHub Action Build <a class="header-anchor" href="#github-action-build" aria-label="Permalink to &quot;GitHub Action Build&quot;"></a></h1><p>Action Build refers to compiling directly using GitHub Action.</p><p>If you don&#39;t want to compile it yourself, you can download the artifact from the existing Action in this project, or you can download it from a self-hosted server<a href="https://dl.static-php.dev/static-php-cli/common/" target="_blank" rel="noreferrer">Enter</a>.</p><blockquote><p>Self-hosted binaries are also built from Actions: <a href="https://github.com/static-php/static-php-cli-hosted" target="_blank" rel="noreferrer">repo</a>. The extensions included are: bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gmp,iconv,xml,mbstring,mbregex,mysqlnd,openssl, pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,redis,session,simplexml,soap,sockets,sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip</p></blockquote><h2 id="build-guide" tabindex="-1">Build Guide <a class="header-anchor" href="#build-guide" aria-label="Permalink to &quot;Build Guide&quot;"></a></h2><p>Using GitHub Action makes it easy to build a statically compiled PHP and phpmicro, while also defining the extensions to compile.</p><ol><li>Fork project.</li><li>Go to the Actions of the project and select <code>CI</code>.</li><li>Select <code>Run workflow</code>, fill in the PHP version you want to compile, the target type, and the list of extensions. (extensions comma separated, e.g. <code>bcmath,curl,mbstring</code>)</li><li>After waiting for about a period of time, enter the corresponding task and get <code>Artifacts</code>.</li></ol><p>If you enable <code>debug</code>, all logs will be output at build time, including compiled logs, for troubleshooting.</p><blockquote><p>If you need to build in other environments, you can use <a href="./manual-build.html">manual build</a>.</p></blockquote><h2 id="extensions" tabindex="-1">Extensions <a class="header-anchor" href="#extensions" aria-label="Permalink to &quot;Extensions&quot;"></a></h2><p>You can go to <a href="./extensions.html">extensions</a> check here to see if all the extensions you need currently support. and then go to <a href="./cli-generator.html">command generator</a> select the extension you need to compile, copy the extensions string to <code>extensions</code> option.</p>',11),l=[a];function s(r,c,d,u,p,h){return o(),t("div",null,l)}const f=e(n,[["render",s]]);export{b as __pageData,f as default};
import{_ as e,c as t,o,a1 as i}from"./chunks/framework.gjrnbxUT.js";const b=JSON.parse('{"title":"GitHub Action Build","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/action-build.md","filePath":"en/guide/action-build.md"}'),n={name:"en/guide/action-build.md"},a=i('<h1 id="github-action-build" tabindex="-1">GitHub Action Build <a class="header-anchor" href="#github-action-build" aria-label="Permalink to &quot;GitHub Action Build&quot;"></a></h1><p>Action Build refers to compiling directly using GitHub Action.</p><p>If you don&#39;t want to compile it yourself, you can download the artifact from the existing Action in this project, or you can download it from a self-hosted server<a href="https://dl.static-php.dev/static-php-cli/common/" target="_blank" rel="noreferrer">Enter</a>.</p><blockquote><p>Self-hosted binaries are also built from Actions: <a href="https://github.com/static-php/static-php-cli-hosted" target="_blank" rel="noreferrer">repo</a>. The extensions included are: bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gmp,iconv,xml,mbstring,mbregex,mysqlnd,openssl, pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,redis,session,simplexml,soap,sockets,sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip</p></blockquote><h2 id="build-guide" tabindex="-1">Build Guide <a class="header-anchor" href="#build-guide" aria-label="Permalink to &quot;Build Guide&quot;"></a></h2><p>Using GitHub Action makes it easy to build a statically compiled PHP and phpmicro, while also defining the extensions to compile.</p><ol><li>Fork project.</li><li>Go to the Actions of the project and select <code>CI</code>.</li><li>Select <code>Run workflow</code>, fill in the PHP version you want to compile, the target type, and the list of extensions. (extensions comma separated, e.g. <code>bcmath,curl,mbstring</code>)</li><li>After waiting for about a period of time, enter the corresponding task and get <code>Artifacts</code>.</li></ol><p>If you enable <code>debug</code>, all logs will be output at build time, including compiled logs, for troubleshooting.</p><blockquote><p>If you need to build in other environments, you can use <a href="./manual-build.html">manual build</a>.</p></blockquote><h2 id="extensions" tabindex="-1">Extensions <a class="header-anchor" href="#extensions" aria-label="Permalink to &quot;Extensions&quot;"></a></h2><p>You can go to <a href="./extensions.html">extensions</a> check here to see if all the extensions you need currently support. and then go to <a href="./cli-generator.html">command generator</a> select the extension you need to compile, copy the extensions string to <code>extensions</code> option.</p>',11),l=[a];function s(r,c,d,u,p,h){return o(),t("div",null,l)}const f=e(n,[["render",s]]);export{b as __pageData,f as default};

View File

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

View File

@ -1,4 +1,4 @@
import{_ as e,c as i,o as s,a1 as a}from"./chunks/framework.CszIUXhs.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(`<h1 id="build-on-windows" tabindex="-1">Build on Windows <a class="header-anchor" href="#build-on-windows" aria-label="Permalink to &quot;Build on Windows&quot;"></a></h1><p>Because the Windows system is an NT kernel, the compilation tools and operating system interfaces used by Unix-like operating systems are almost completely different, so the build process on Windows will be slightly different from that of Unix systems.</p><h2 id="github-actions-build" tabindex="-1">GitHub Actions Build <a class="header-anchor" href="#github-actions-build" aria-label="Permalink to &quot;GitHub Actions Build&quot;"></a></h2><p>Building the Windows version of static-php from Actions is now supported. Like Linux and macOS, you need to Fork the static-php-cli repository to your GitHub account first, then you can enter <a href="./extensions.html">Extension List</a> to select the extension to be compiled, and then go to your own <code>CI on Windows</code> select the PHP version, fill in the extension list (comma separated), and click Run.</p><p>If you&#39;re going to develop or build locally, please read on.</p><h2 id="requirements" tabindex="-1">Requirements <a class="header-anchor" href="#requirements" aria-label="Permalink to &quot;Requirements&quot;"></a></h2><p>The tools required to build static PHP on Windows are the same as PHP&#39;s official Windows build tools. You can read <a href="https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2" target="_blank" rel="noreferrer">Official Documentation</a>.</p><p>To sum up, you need the following environment and tools:</p><ul><li>Windows 10/11 (requires build 17063 or later)</li><li>Visual Studio 2019/2022 (recommended 2022)</li><li>C++ desktop development for Visual Studio</li><li>Git for Windows</li><li><a href="https://github.com/php/php-sdk-binary-tools" target="_blank" rel="noreferrer">php-sdk-binary-tools</a> (can be installed automatically using doctor)</li><li>strawberry-perl (can be installed automatically using doctor)</li><li>nasm (can be installed automatically using doctor)</li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The construction of static-php-cli on Windows refers to using MSVC to build PHP and is not based on MinGW, Cygwin, WSL and other environments.</p><p>If you prefer to use WSL, please refer to the chapter on Building on Linux.</p></div><p>After installing Visual Studio and selecting the C++ desktop development workload, you may download about 8GB of compilation tools, and the download speed depends on your network conditions.</p><h3 id="install-git" tabindex="-1">Install Git <a class="header-anchor" href="#install-git" aria-label="Permalink to &quot;Install Git&quot;"></a></h3><p>Git for Windows can be downloaded and installed from <a href="https://git-scm.com/download/win" target="_blank" rel="noreferrer">here</a> <code>Standalone Installer 64-bit</code> version, installed in the default location (<code>C:\\Program Files\\Git\\</code>). If you don&#39;t want to download and install manually, you can also use Visual Studio Installer and check Git in the <strong>Individual component</strong> tab.</p><h3 id="prepare-static-php-cli" tabindex="-1">Prepare static-php-cli <a class="header-anchor" href="#prepare-static-php-cli" aria-label="Permalink to &quot;Prepare static-php-cli&quot;"></a></h3><p>Downloading the static-php-cli project is very simple, just use git clone. It is recommended to place the project in <code>C:\\spc-build\\</code> or a similar directory. It is best <strong>not to have spaces in the path</strong>.</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;">mkdir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;C:\\spc-build&quot;</span></span>
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(`<h1 id="build-on-windows" tabindex="-1">Build on Windows <a class="header-anchor" href="#build-on-windows" aria-label="Permalink to &quot;Build on Windows&quot;"></a></h1><p>Because the Windows system is an NT kernel, the compilation tools and operating system interfaces used by Unix-like operating systems are almost completely different, so the build process on Windows will be slightly different from that of Unix systems.</p><h2 id="github-actions-build" tabindex="-1">GitHub Actions Build <a class="header-anchor" href="#github-actions-build" aria-label="Permalink to &quot;GitHub Actions Build&quot;"></a></h2><p>Building the Windows version of static-php from Actions is now supported. Like Linux and macOS, you need to Fork the static-php-cli repository to your GitHub account first, then you can enter <a href="./extensions.html">Extension List</a> to select the extension to be compiled, and then go to your own <code>CI on Windows</code> select the PHP version, fill in the extension list (comma separated), and click Run.</p><p>If you&#39;re going to develop or build locally, please read on.</p><h2 id="requirements" tabindex="-1">Requirements <a class="header-anchor" href="#requirements" aria-label="Permalink to &quot;Requirements&quot;"></a></h2><p>The tools required to build static PHP on Windows are the same as PHP&#39;s official Windows build tools. You can read <a href="https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2" target="_blank" rel="noreferrer">Official Documentation</a>.</p><p>To sum up, you need the following environment and tools:</p><ul><li>Windows 10/11 (requires build 17063 or later)</li><li>Visual Studio 2019/2022 (recommended 2022)</li><li>C++ desktop development for Visual Studio</li><li>Git for Windows</li><li><a href="https://github.com/php/php-sdk-binary-tools" target="_blank" rel="noreferrer">php-sdk-binary-tools</a> (can be installed automatically using doctor)</li><li>strawberry-perl (can be installed automatically using doctor)</li><li>nasm (can be installed automatically using doctor)</li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The construction of static-php-cli on Windows refers to using MSVC to build PHP and is not based on MinGW, Cygwin, WSL and other environments.</p><p>If you prefer to use WSL, please refer to the chapter on Building on Linux.</p></div><p>After installing Visual Studio and selecting the C++ desktop development workload, you may download about 8GB of compilation tools, and the download speed depends on your network conditions.</p><h3 id="install-git" tabindex="-1">Install Git <a class="header-anchor" href="#install-git" aria-label="Permalink to &quot;Install Git&quot;"></a></h3><p>Git for Windows can be downloaded and installed from <a href="https://git-scm.com/download/win" target="_blank" rel="noreferrer">here</a> <code>Standalone Installer 64-bit</code> version, installed in the default location (<code>C:\\Program Files\\Git\\</code>). If you don&#39;t want to download and install manually, you can also use Visual Studio Installer and check Git in the <strong>Individual component</strong> tab.</p><h3 id="prepare-static-php-cli" tabindex="-1">Prepare static-php-cli <a class="header-anchor" href="#prepare-static-php-cli" aria-label="Permalink to &quot;Prepare static-php-cli&quot;"></a></h3><p>Downloading the static-php-cli project is very simple, just use git clone. It is recommended to place the project in <code>C:\\spc-build\\</code> or a similar directory. It is best <strong>not to have spaces in the path</strong>.</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;">mkdir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;C:\\spc-build&quot;</span></span>
<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>
<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/crazywhalecc/static-php-cli.git</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> static-php-cli</span></span></code></pre></div><p>It is a bit strange that static-php-cli itself requires a PHP environment, but now you can quickly install the PHP environment through a script. Generally, your computer will not have the Windows version of PHP installed, so we recommend that you use <code>bin/setup-runtime</code> directly after downloading static-php-cli to install PHP and Composer in the current directory.</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:#6A737D;--shiki-dark:#6A737D;"># Install PHP and Composer to the ./runtime/ directory</span></span>

View File

@ -1 +1 @@
import{_ as e,c as i,o as s,a1 as a}from"./chunks/framework.CszIUXhs.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("",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};

View File

@ -1 +1 @@
import{C as e}from"./chunks/CliGenerator.CID4JyzZ.js";import{d as t,c as a,I as o,a1 as n,o as r}from"./chunks/framework.CszIUXhs.js";const i=n('<h1 id="cli-build-command-generator" tabindex="-1">CLI Build Command Generator <a class="header-anchor" href="#cli-build-command-generator" aria-label="Permalink to &quot;CLI Build Command Generator&quot;"></a></h1><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The extensions selected below may contain extensions that are not supported by the selected operating system, which may cause compilation to fail. Please check <a href="./extensions.html">Supported Extensions</a> first.</p></div>',2),u=JSON.parse('{"title":"CLI Build Command Generator","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/cli-generator.md","filePath":"en/guide/cli-generator.md"}'),s={name:"en/guide/cli-generator.md"},h=t({...s,setup(c){return(l,d)=>(r(),a("div",null,[i,o(e,{lang:"en"})]))}});export{u as __pageData,h as default};
import{C as e}from"./chunks/CliGenerator.D06x6nXS.js";import{d as t,c as a,I as o,a1 as n,o as r}from"./chunks/framework.gjrnbxUT.js";const i=n('<h1 id="cli-build-command-generator" tabindex="-1">CLI Build Command Generator <a class="header-anchor" href="#cli-build-command-generator" aria-label="Permalink to &quot;CLI Build Command Generator&quot;"></a></h1><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The extensions selected below may contain extensions that are not supported by the selected operating system, which may cause compilation to fail. Please check <a href="./extensions.html">Supported Extensions</a> first.</p></div>',2),u=JSON.parse('{"title":"CLI Build Command Generator","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"en/guide/cli-generator.md","filePath":"en/guide/cli-generator.md"}'),s={name:"en/guide/cli-generator.md"},h=t({...s,setup(c){return(l,d)=>(r(),a("div",null,[i,o(e,{lang:"en"})]))}});export{u as __pageData,h as default};

View File

@ -1 +1 @@
import{C as e}from"./chunks/CliGenerator.CID4JyzZ.js";import{d as t,c as a,I as o,a1 as n,o as r}from"./chunks/framework.CszIUXhs.js";const i=n('<h1 id="cli-build-command-generator" tabindex="-1">CLI Build Command Generator <a class="header-anchor" href="#cli-build-command-generator" aria-label="Permalink to &quot;CLI Build Command Generator&quot;"></a></h1><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The extensions selected below may contain extensions that are not supported by the selected operating system, which may cause compilation to fail. Please check <a href="./extensions.html">Supported Extensions</a> first.</p></div>',2),u=JSON.parse('{"title":"CLI Build Command Generator","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/cli-generator.md","filePath":"en/guide/cli-generator.md"}'),s={name:"en/guide/cli-generator.md"},h=t({...s,setup(c){return(l,d)=>(r(),a("div",null,[i,o(e,{lang:"en"})]))}});export{u as __pageData,h as default};
import{C as e}from"./chunks/CliGenerator.D06x6nXS.js";import{d as t,c as a,I as o,a1 as n,o as r}from"./chunks/framework.gjrnbxUT.js";const i=n('<h1 id="cli-build-command-generator" tabindex="-1">CLI Build Command Generator <a class="header-anchor" href="#cli-build-command-generator" aria-label="Permalink to &quot;CLI Build Command Generator&quot;"></a></h1><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The extensions selected below may contain extensions that are not supported by the selected operating system, which may cause compilation to fail. Please check <a href="./extensions.html">Supported Extensions</a> first.</p></div>',2),u=JSON.parse('{"title":"CLI Build Command Generator","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"en/guide/cli-generator.md","filePath":"en/guide/cli-generator.md"}'),s={name:"en/guide/cli-generator.md"},h=t({...s,setup(c){return(l,d)=>(r(),a("div",null,[i,o(e,{lang:"en"})]))}});export{u as __pageData,h as default};

File diff suppressed because one or more lines are too long

View File

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

View File

@ -1,4 +1,4 @@
import{_ as e,c as t,o as i,a1 as a}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"Environment variables","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/env-vars.md","filePath":"en/guide/env-vars.md"}'),n={name:"en/guide/env-vars.md"},s=a(`<h1 id="environment-variables" tabindex="-1">Environment variables <a class="header-anchor" href="#environment-variables" aria-label="Permalink to &quot;Environment variables&quot;"></a></h1><p>All environment variables mentioned in the list on this page have default values unless otherwise noted. You can override the default values by setting these environment variables.</p><h2 id="environment-variables-list" tabindex="-1">Environment variables list <a class="header-anchor" href="#environment-variables-list" aria-label="Permalink to &quot;Environment variables list&quot;"></a></h2><p>Starting from version 2.3.5, we have centralized the environment variables in the <code>config/env.ini</code> file. You can set environment variables by modifying this file.</p><p>We divide the environment variables supported by static-php-cli into three types:</p><ul><li>Global internal environment variables: declared after static-php-cli starts, you can use <code>getenv()</code> to get them internally in static-php-cli, and you can override them before starting static-php-cli.</li><li>Fixed environment variables: declared after static-php-cli starts, you can only use <code>getenv()</code> to get them, but you cannot override them through shell scripts.</li><li>Config file environment variables: declared before static-php-cli build, you can set these environment variables by modifying the <code>config/env.ini</code> file or through shell scripts.</li></ul><p>You can read the comments for each parameter in <a href="https://github.com/crazywhalecc/static-php-cli/blob/main/config/env.ini" target="_blank" rel="noreferrer">config/env.ini</a> to understand its purpose.</p><h2 id="custom-environment-variables" tabindex="-1">Custom environment variables <a class="header-anchor" href="#custom-environment-variables" aria-label="Permalink to &quot;Custom environment variables&quot;"></a></h2><p>Generally, you don&#39;t need to modify any of the following environment variables as they are already set to optimal values. However, if you have special needs, you can set these environment variables to meet your needs (for example, you need to debug PHP performance under different compilation parameters).</p><p>If you want to use custom environment variables, you can use the <code>export</code> command in the terminal or set the environment variables directly before the command, for example:</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:#6A737D;--shiki-dark:#6A737D;"># export first</span></span>
import{_ as e,c as t,o as i,a1 as a}from"./chunks/framework.gjrnbxUT.js";const b=JSON.parse('{"title":"Environment variables","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/env-vars.md","filePath":"en/guide/env-vars.md"}'),n={name:"en/guide/env-vars.md"},s=a(`<h1 id="environment-variables" tabindex="-1">Environment variables <a class="header-anchor" href="#environment-variables" aria-label="Permalink to &quot;Environment variables&quot;"></a></h1><p>All environment variables mentioned in the list on this page have default values unless otherwise noted. You can override the default values by setting these environment variables.</p><h2 id="environment-variables-list" tabindex="-1">Environment variables list <a class="header-anchor" href="#environment-variables-list" aria-label="Permalink to &quot;Environment variables list&quot;"></a></h2><p>Starting from version 2.3.5, we have centralized the environment variables in the <code>config/env.ini</code> file. You can set environment variables by modifying this file.</p><p>We divide the environment variables supported by static-php-cli into three types:</p><ul><li>Global internal environment variables: declared after static-php-cli starts, you can use <code>getenv()</code> to get them internally in static-php-cli, and you can override them before starting static-php-cli.</li><li>Fixed environment variables: declared after static-php-cli starts, you can only use <code>getenv()</code> to get them, but you cannot override them through shell scripts.</li><li>Config file environment variables: declared before static-php-cli build, you can set these environment variables by modifying the <code>config/env.ini</code> file or through shell scripts.</li></ul><p>You can read the comments for each parameter in <a href="https://github.com/crazywhalecc/static-php-cli/blob/main/config/env.ini" target="_blank" rel="noreferrer">config/env.ini</a> to understand its purpose.</p><h2 id="custom-environment-variables" tabindex="-1">Custom environment variables <a class="header-anchor" href="#custom-environment-variables" aria-label="Permalink to &quot;Custom environment variables&quot;"></a></h2><p>Generally, you don&#39;t need to modify any of the following environment variables as they are already set to optimal values. However, if you have special needs, you can set these environment variables to meet your needs (for example, you need to debug PHP performance under different compilation parameters).</p><p>If you want to use custom environment variables, you can use the <code>export</code> command in the terminal or set the environment variables directly before the command, for example:</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:#6A737D;--shiki-dark:#6A737D;"># export first</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> SPC_CONCURRENCY</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">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;"> build</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> mbstring,pcntl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build-cli</span></span>
<span class="line"></span>

View File

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

View File

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

View File

@ -0,0 +1 @@
import{_ as t}from"./chunks/SearchTable.CvLKjgM6.js";import{c as o,I as i,a1 as e,o as s}from"./chunks/framework.gjrnbxUT.js";const a=e('<h1 id="extensions" tabindex="-1">Extensions <a class="header-anchor" href="#extensions" aria-label="Permalink to &quot;Extensions&quot;"></a></h1><blockquote><ul><li><code>yes</code>: supported</li><li><em>blank</em>: not supported yet, or WIP</li><li><code>no</code> with issue link: confirmed to be unavailable due to issue</li><li><code>partial</code> with issue link: supported but not perfect due to issue</li></ul></blockquote>',2),n=e('<div class="tip custom-block"><p class="custom-block-title">TIP</p><p>If an extension you need is missing, you can create a <a href="https://github.com/crazywhalecc/static-php-cli/issues" target="_blank" rel="noreferrer">Feature Request</a>.</p><p>Some extensions or libraries that the extension depends on will have some optional features. For example, the gd library optionally supports libwebp, freetype, etc. If you only use <code>bin/spc build gd --build-cli</code> they will not be included (static-php-cli defaults to the minimum dependency principle).</p><p>For more information about optional libraries, see <a href="./deps-map.html">Extensions, Library Dependency Map</a>. For optional libraries, you can also select an extension from the <a href="./cli-generator.html">Command Generator</a> and then select optional libraries.</p></div>',1),_=JSON.parse('{"title":"Extensions","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/extensions.md","filePath":"en/guide/extensions.md"}'),l={name:"en/guide/extensions.md"},m=Object.assign(l,{setup(r){return(c,p)=>(s(),o("div",null,[a,i(t),n]))}});export{_ as __pageData,m as default};

View File

@ -0,0 +1 @@
import{_ as t}from"./chunks/SearchTable.CvLKjgM6.js";import{c as o,I as i,a1 as e,o as s}from"./chunks/framework.gjrnbxUT.js";const a=e("",2),n=e("",1),_=JSON.parse('{"title":"Extensions","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/extensions.md","filePath":"en/guide/extensions.md"}'),l={name:"en/guide/extensions.md"},m=Object.assign(l,{setup(r){return(c,p)=>(s(),o("div",null,[a,i(t),n]))}});export{_ as __pageData,m as default};

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{_ as t,c as d,o as e,a1 as s}from"./chunks/framework.CszIUXhs.js";const x=JSON.parse('{"title":"Extensions","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/extensions.md","filePath":"en/guide/extensions.md"}'),r={name:"en/guide/extensions.md"},y=s("",4),o=[y];function n(a,i,l,h,p,m){return e(),d("div",null,o)}const f=t(r,[["render",n]]);export{x as __pageData,f as default};

View File

@ -1 +1 @@
import{_ as e,c as t,o,a1 as i}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"Guide","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/index.md","filePath":"en/guide/index.md"}'),n={name:"en/guide/index.md"},r=i('<h1 id="guide" tabindex="-1">Guide <a class="header-anchor" href="#guide" aria-label="Permalink to &quot;Guide&quot;"></a></h1><p>Static php cli is a tool used to build statically compiled PHP binaries, currently supporting Linux and macOS systems.</p><p>In the guide section, you will learn how to use static php cli to build standalone PHP programs.</p><ul><li><a href="./action-build.html">GitHub Action Build</a></li><li><a href="./manual-build.html">Manual Build</a></li><li><a href="./extensions.html">Supported Extensions</a></li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>If you are a native English speaker, some corrections to the documentation are welcome.</p></div><h2 id="compilation-environment" tabindex="-1">Compilation Environment <a class="header-anchor" href="#compilation-environment" aria-label="Permalink to &quot;Compilation Environment&quot;"></a></h2><p>The following is the architecture support situation, where ⚙️ represents support for GitHub Action build, 💻 represents support for local manual build, and empty represents temporarily not supported.</p><table tabindex="0"><thead><tr><th></th><th>x86_64</th><th>aarch64</th></tr></thead><tbody><tr><td>macOS</td><td>⚙️ 💻</td><td>⚙️ 💻</td></tr><tr><td>Linux</td><td>⚙️ 💻</td><td>⚙️ 💻</td></tr><tr><td>Windows</td><td>⚙️ 💻</td><td></td></tr><tr><td>FreeBSD</td><td>💻</td><td>💻</td></tr></tbody></table><p>Among them, Linux is currently only tested on Ubuntu, Debian, and Alpine distributions, and other distributions have not been tested, which cannot guarantee successful compilation. For untested distributions, local compilation can be done using methods such as Docker to avoid environmental issues.</p><p>There are two architectures for macOS: <code>x86_64</code> and <code>Arm</code>, but binaries compiled on one architecture cannot be directly used on the other architecture. Rosetta 2 cannot guarantee that programs compiled with <code>Arm</code> architecture can fully run on <code>x86_64</code> environment.</p><p>Windows currently only supports the x86_64 architecture, and does not support 32-bit x86 or arm64 architecture.</p><h2 id="supported-php-version" tabindex="-1">Supported PHP Version <a class="header-anchor" href="#supported-php-version" aria-label="Permalink to &quot;Supported PHP Version&quot;"></a></h2><p>Currently, static php cli supports PHP versions 8.0 to 8.3, and theoretically supports PHP 7.4 and earlier versions. Simply select the earlier version when downloading. However, due to some extensions and special components that have stopped supporting earlier versions of PHP, static-php-cli will not explicitly support earlier versions. We recommend that you compile the latest PHP version possible for a better experience.</p>',13),a=[r];function s(d,l,c,p,u,h){return o(),t("div",null,a)}const _=e(n,[["render",s]]);export{b as __pageData,_ as default};
import{_ as e,c as t,o,a1 as i}from"./chunks/framework.gjrnbxUT.js";const b=JSON.parse('{"title":"Guide","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/index.md","filePath":"en/guide/index.md"}'),n={name:"en/guide/index.md"},r=i('<h1 id="guide" tabindex="-1">Guide <a class="header-anchor" href="#guide" aria-label="Permalink to &quot;Guide&quot;"></a></h1><p>Static php cli is a tool used to build statically compiled PHP binaries, currently supporting Linux and macOS systems.</p><p>In the guide section, you will learn how to use static php cli to build standalone PHP programs.</p><ul><li><a href="./action-build.html">GitHub Action Build</a></li><li><a href="./manual-build.html">Manual Build</a></li><li><a href="./extensions.html">Supported Extensions</a></li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>If you are a native English speaker, some corrections to the documentation are welcome.</p></div><h2 id="compilation-environment" tabindex="-1">Compilation Environment <a class="header-anchor" href="#compilation-environment" aria-label="Permalink to &quot;Compilation Environment&quot;"></a></h2><p>The following is the architecture support situation, where ⚙️ represents support for GitHub Action build, 💻 represents support for local manual build, and empty represents temporarily not supported.</p><table tabindex="0"><thead><tr><th></th><th>x86_64</th><th>aarch64</th></tr></thead><tbody><tr><td>macOS</td><td>⚙️ 💻</td><td>⚙️ 💻</td></tr><tr><td>Linux</td><td>⚙️ 💻</td><td>⚙️ 💻</td></tr><tr><td>Windows</td><td>⚙️ 💻</td><td></td></tr><tr><td>FreeBSD</td><td>💻</td><td>💻</td></tr></tbody></table><p>Among them, Linux is currently only tested on Ubuntu, Debian, and Alpine distributions, and other distributions have not been tested, which cannot guarantee successful compilation. For untested distributions, local compilation can be done using methods such as Docker to avoid environmental issues.</p><p>There are two architectures for macOS: <code>x86_64</code> and <code>Arm</code>, but binaries compiled on one architecture cannot be directly used on the other architecture. Rosetta 2 cannot guarantee that programs compiled with <code>Arm</code> architecture can fully run on <code>x86_64</code> environment.</p><p>Windows currently only supports the x86_64 architecture, and does not support 32-bit x86 or arm64 architecture.</p><h2 id="supported-php-version" tabindex="-1">Supported PHP Version <a class="header-anchor" href="#supported-php-version" aria-label="Permalink to &quot;Supported PHP Version&quot;"></a></h2><p>Currently, static php cli supports PHP versions 8.0 to 8.3, and theoretically supports PHP 7.4 and earlier versions. Simply select the earlier version when downloading. However, due to some extensions and special components that have stopped supporting earlier versions of PHP, static-php-cli will not explicitly support earlier versions. We recommend that you compile the latest PHP version possible for a better experience.</p>',13),a=[r];function s(d,l,c,p,u,h){return o(),t("div",null,a)}const _=e(n,[["render",s]]);export{b as __pageData,_ as default};

View File

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

View File

@ -1,4 +1,4 @@
import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"Build (Linux, macOS, FreeBSD)","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/manual-build.md","filePath":"en/guide/manual-build.md"}'),n={name:"en/guide/manual-build.md"},t=a(`<h1 id="build-linux-macos-freebsd" tabindex="-1">Build (Linux, macOS, FreeBSD) <a class="header-anchor" href="#build-linux-macos-freebsd" aria-label="Permalink to &quot;Build (Linux, macOS, FreeBSD)&quot;"></a></h1><p>This section covers the build process for Linux, macOS, and FreeBSD. If you want to build on Windows, also need to read <a href="./build-on-windows.html">Build on Windows</a>.</p><h3 id="build-locally-using-spc-binary-recommended" tabindex="-1">Build locally (using SPC binary) (recommended) <a class="header-anchor" href="#build-locally-using-spc-binary-recommended" aria-label="Permalink to &quot;Build locally (using SPC binary) (recommended)&quot;"></a></h3><p>This project provides a binary file of static-php-cli. You can directly download the binary file of the corresponding platform and then use it to build static PHP. Currently, the platforms supported by <code>spc</code> binary are Linux and macOS.</p><p>Here&#39;s how to download from self-hosted server:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</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;"># Download from self-hosted nightly builds (sync with main branch)</span></span>
import{_ as s,c as i,o as e,a1 as a}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"Build (Linux, macOS, FreeBSD)","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/manual-build.md","filePath":"en/guide/manual-build.md"}'),n={name:"en/guide/manual-build.md"},t=a(`<h1 id="build-linux-macos-freebsd" tabindex="-1">Build (Linux, macOS, FreeBSD) <a class="header-anchor" href="#build-linux-macos-freebsd" aria-label="Permalink to &quot;Build (Linux, macOS, FreeBSD)&quot;"></a></h1><p>This section covers the build process for Linux, macOS, and FreeBSD. If you want to build on Windows, also need to read <a href="./build-on-windows.html">Build on Windows</a>.</p><h3 id="build-locally-using-spc-binary-recommended" tabindex="-1">Build locally (using SPC binary) (recommended) <a class="header-anchor" href="#build-locally-using-spc-binary-recommended" aria-label="Permalink to &quot;Build locally (using SPC binary) (recommended)&quot;"></a></h3><p>This project provides a binary file of static-php-cli. You can directly download the binary file of the corresponding platform and then use it to build static PHP. Currently, the platforms supported by <code>spc</code> binary are Linux and macOS.</p><p>Here&#39;s how to download from self-hosted server:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</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;"># Download from self-hosted nightly builds (sync with main branch)</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># For Linux x86_64</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -fsSL</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># For Linux aarch64</span></span>

View File

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

View File

@ -1 +1 @@
import{_ as e,c as o,o as t,a1 as a}from"./chunks/framework.CszIUXhs.js";const f=JSON.parse('{"title":"Troubleshooting","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/troubleshooting.md","filePath":"en/guide/troubleshooting.md"}'),r={name:"en/guide/troubleshooting.md"},n=a('<h1 id="troubleshooting" tabindex="-1">Troubleshooting <a class="header-anchor" href="#troubleshooting" aria-label="Permalink to &quot;Troubleshooting&quot;"></a></h1><p>Various failures may be encountered in the process of using static-php-cli, here will describe how to check the errors by yourself and report Issue.</p><h2 id="download-failure" tabindex="-1">Download Failure <a class="header-anchor" href="#download-failure" aria-label="Permalink to &quot;Download Failure&quot;"></a></h2><p>Problems with downloading resources are one of the most common problems with spc. The main reason is that the addresses used for SPC download resources are generally the official website of the corresponding project or GitHub, etc., and these websites may occasionally go down and block IP addresses. Currently, version 2.0.0 has not added an automatic retry mechanism, so after encountering a download failure, you can try to call the download command multiple times. If you confirm that the address is indeed inaccessible, you can submit an Issue or PR to update the url or download type.</p><h2 id="doctor-can-t-fix-something" tabindex="-1">Doctor Can&#39;t Fix Something <a class="header-anchor" href="#doctor-can-t-fix-something" aria-label="Permalink to &quot;Doctor Can&#39;t Fix Something&quot;"></a></h2><p>In most cases, the doctor module can automatically repair and install missing system environments, but there are also special circumstances where the automatic repair function cannot be used normally.</p><p>Due to system limitations (for example, software such as Visual Studio cannot be automatically installed under Windows), the automatic repair function cannot be used for some projects. When encountering a function that cannot be automatically repaired, if you encounter the words <code>Some check items can not be fixed</code>, it means that it cannot be automatically repaired. Please submit an issue according to the method displayed on the terminal or repair the environment yourself.</p><h2 id="compile-error" tabindex="-1">Compile Error <a class="header-anchor" href="#compile-error" aria-label="Permalink to &quot;Compile Error&quot;"></a></h2><p>When you encounter a compilation error, if the <code>--debug</code> log is not enabled, please enable the debug log first, and then determine the command that reported the error. The error terminal output is very important for fixing compilation errors. When submitting an issue, please upload the last error fragment of the terminal log (or the entire terminal log output), and include the <code>spc</code> command and parameters used.</p>',9),i=[n];function s(l,c,d,u,h,m){return t(),o("div",null,i)}const b=e(r,[["render",s]]);export{f as __pageData,b as default};
import{_ as e,c as o,o as t,a1 as a}from"./chunks/framework.gjrnbxUT.js";const f=JSON.parse('{"title":"Troubleshooting","description":"","frontmatter":{},"headers":[],"relativePath":"en/guide/troubleshooting.md","filePath":"en/guide/troubleshooting.md"}'),r={name:"en/guide/troubleshooting.md"},n=a('<h1 id="troubleshooting" tabindex="-1">Troubleshooting <a class="header-anchor" href="#troubleshooting" aria-label="Permalink to &quot;Troubleshooting&quot;"></a></h1><p>Various failures may be encountered in the process of using static-php-cli, here will describe how to check the errors by yourself and report Issue.</p><h2 id="download-failure" tabindex="-1">Download Failure <a class="header-anchor" href="#download-failure" aria-label="Permalink to &quot;Download Failure&quot;"></a></h2><p>Problems with downloading resources are one of the most common problems with spc. The main reason is that the addresses used for SPC download resources are generally the official website of the corresponding project or GitHub, etc., and these websites may occasionally go down and block IP addresses. Currently, version 2.0.0 has not added an automatic retry mechanism, so after encountering a download failure, you can try to call the download command multiple times. If you confirm that the address is indeed inaccessible, you can submit an Issue or PR to update the url or download type.</p><h2 id="doctor-can-t-fix-something" tabindex="-1">Doctor Can&#39;t Fix Something <a class="header-anchor" href="#doctor-can-t-fix-something" aria-label="Permalink to &quot;Doctor Can&#39;t Fix Something&quot;"></a></h2><p>In most cases, the doctor module can automatically repair and install missing system environments, but there are also special circumstances where the automatic repair function cannot be used normally.</p><p>Due to system limitations (for example, software such as Visual Studio cannot be automatically installed under Windows), the automatic repair function cannot be used for some projects. When encountering a function that cannot be automatically repaired, if you encounter the words <code>Some check items can not be fixed</code>, it means that it cannot be automatically repaired. Please submit an issue according to the method displayed on the terminal or repair the environment yourself.</p><h2 id="compile-error" tabindex="-1">Compile Error <a class="header-anchor" href="#compile-error" aria-label="Permalink to &quot;Compile Error&quot;"></a></h2><p>When you encounter a compilation error, if the <code>--debug</code> log is not enabled, please enable the debug log first, and then determine the command that reported the error. The error terminal output is very important for fixing compilation errors. When submitting an issue, please upload the last error fragment of the terminal log (or the entire terminal log output), and include the <code>spc</code> command and parameters used.</p>',9),i=[n];function s(l,c,d,u,h,m){return t(),o("div",null,i)}const b=e(r,[["render",s]]);export{f as __pageData,b as default};

View File

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

View File

@ -1 +1 @@
import{_ as e,c as t,o as a}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.","actions":[{"theme":"brand","text":"Guide","link":"./guide/"}]},"features":[{"title":"Static CLI Binary","details":"You can easily compile a standalone php binary for general use. Including CLI, FPM sapi."},{"title":"Micro Self-Extracted Executable","details":"You can compile a self-extracted executable and build with your php source code."},{"title":"Dependency Management","details":"static-php-cli comes with dependency management and supports installation of different types of PHP extensions."}]},"headers":[],"relativePath":"en/index.md","filePath":"en/index.md"}'),n={name:"en/index.md"};function i(o,s,c,d,r,l){return a(),t("div")}const m=e(n,[["render",i]]);export{u as __pageData,m as default};
import{_ as e,c as t,o as a}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.","actions":[{"theme":"brand","text":"Guide","link":"./guide/"}]},"features":[{"title":"Static CLI Binary","details":"You can easily compile a standalone php binary for general use. Including CLI, FPM sapi."},{"title":"Micro Self-Extracted Executable","details":"You can compile a self-extracted executable and build with your php source code."},{"title":"Dependency Management","details":"static-php-cli comes with dependency management and supports installation of different types of PHP extensions."}]},"headers":[],"relativePath":"en/index.md","filePath":"en/index.md"}'),n={name:"en/index.md"};function i(o,s,c,d,r,l){return a(),t("div")}const m=e(n,[["render",i]]);export{u as __pageData,m as default};

View File

@ -1 +1 @@
import{_ as e,c as t,o as a}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.","actions":[{"theme":"brand","text":"Guide","link":"./guide/"}]},"features":[{"title":"Static CLI Binary","details":"You can easily compile a standalone php binary for general use. Including CLI, FPM sapi."},{"title":"Micro Self-Extracted Executable","details":"You can compile a self-extracted executable and build with your php source code."},{"title":"Dependency Management","details":"static-php-cli comes with dependency management and supports installation of different types of PHP extensions."}]},"headers":[],"relativePath":"en/index.md","filePath":"en/index.md"}'),n={name:"en/index.md"};function i(o,s,c,d,r,l){return a(),t("div")}const m=e(n,[["render",i]]);export{u as __pageData,m as default};
import{_ as e,c as t,o as a}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.","actions":[{"theme":"brand","text":"Guide","link":"./guide/"}]},"features":[{"title":"Static CLI Binary","details":"You can easily compile a standalone php binary for general use. Including CLI, FPM sapi."},{"title":"Micro Self-Extracted Executable","details":"You can compile a self-extracted executable and build with your php source code."},{"title":"Dependency Management","details":"static-php-cli comes with dependency management and supports installation of different types of PHP extensions."}]},"headers":[],"relativePath":"en/index.md","filePath":"en/index.md"}'),n={name:"en/index.md"};function i(o,s,c,d,r,l){return a(),t("div")}const m=e(n,[["render",i]]);export{u as __pageData,m as default};

View File

@ -1 +1 @@
import{_ as e,c as t,o as n}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"extension-notes.md","filePath":"extension-notes.md"}'),o={name:"extension-notes.md"};function s(a,r,c,i,p,_){return n(),t("div")}const f=e(o,[["render",s]]);export{m as __pageData,f as default};
import{_ as e,c as t,o as n}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"extension-notes.md","filePath":"extension-notes.md"}'),o={name:"extension-notes.md"};function s(a,r,c,i,p,_){return n(),t("div")}const f=e(o,[["render",s]]);export{m as __pageData,f as default};

View File

@ -1 +1 @@
import{_ as e,c as t,o as n}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"extension-notes.md","filePath":"extension-notes.md"}'),o={name:"extension-notes.md"};function s(a,r,c,i,p,_){return n(),t("div")}const f=e(o,[["render",s]]);export{m as __pageData,f as default};
import{_ as e,c as t,o as n}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"extension-notes.md","filePath":"extension-notes.md"}'),o={name:"extension-notes.md"};function s(a,r,c,i,p,_){return n(),t("div")}const f=e(o,[["render",s]]);export{m as __pageData,f as default};

File diff suppressed because one or more lines are too long

View File

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

View File

@ -1 +1 @@
import{_ as e,c as t,o as a}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.","actions":[{"theme":"brand","text":"Get Started","link":"/en/guide/"},{"theme":"alt","text":"中文文档","link":"/zh/"}]},"features":[{"title":"Static CLI Binary","details":"You can easily compile a standalone php binary for general use. Including CLI, FPM sapi."},{"title":"Micro Self-Extracted Executable","details":"You can compile a self-extracted executable and build with your php source code."},{"title":"Dependency Management","details":"static-php-cli comes with dependency management and supports installation of different types of PHP extensions."}]},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),n={name:"index.md"};function i(o,s,c,r,d,l){return a(),t("div")}const m=e(n,[["render",i]]);export{u as __pageData,m as default};
import{_ as e,c as t,o as a}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.","actions":[{"theme":"brand","text":"Get Started","link":"/en/guide/"},{"theme":"alt","text":"中文文档","link":"/zh/"}]},"features":[{"title":"Static CLI Binary","details":"You can easily compile a standalone php binary for general use. Including CLI, FPM sapi."},{"title":"Micro Self-Extracted Executable","details":"You can compile a self-extracted executable and build with your php source code."},{"title":"Dependency Management","details":"static-php-cli comes with dependency management and supports installation of different types of PHP extensions."}]},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),n={name:"index.md"};function i(o,s,c,r,d,l){return a(),t("div")}const m=e(n,[["render",i]]);export{u as __pageData,m as default};

View File

@ -1 +1 @@
import{_ as e,c as t,o as a}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.","actions":[{"theme":"brand","text":"Get Started","link":"/en/guide/"},{"theme":"alt","text":"中文文档","link":"/zh/"}]},"features":[{"title":"Static CLI Binary","details":"You can easily compile a standalone php binary for general use. Including CLI, FPM sapi."},{"title":"Micro Self-Extracted Executable","details":"You can compile a self-extracted executable and build with your php source code."},{"title":"Dependency Management","details":"static-php-cli comes with dependency management and supports installation of different types of PHP extensions."}]},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),n={name:"index.md"};function i(o,s,c,r,d,l){return a(),t("div")}const m=e(n,[["render",i]]);export{u as __pageData,m as default};
import{_ as e,c as t,o as a}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.","actions":[{"theme":"brand","text":"Get Started","link":"/en/guide/"},{"theme":"alt","text":"中文文档","link":"/zh/"}]},"features":[{"title":"Static CLI Binary","details":"You can easily compile a standalone php binary for general use. Including CLI, FPM sapi."},{"title":"Micro Self-Extracted Executable","details":"You can compile a self-extracted executable and build with your php source code."},{"title":"Dependency Management","details":"static-php-cli comes with dependency management and supports installation of different types of PHP extensions."}]},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),n={name:"index.md"};function i(o,s,c,r,d,l){return a(),t("div")}const m=e(n,[["render",i]]);export{u as __pageData,m as default};

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 @@
import{_ as e,c as a,o,a1 as i}from"./chunks/framework.CszIUXhs.js";const _=JSON.parse('{"title":"贡献指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/contributing/index.md","filePath":"zh/contributing/index.md"}'),l={name:"zh/contributing/index.md"},t=i('<h1 id="贡献指南" tabindex="-1">贡献指南 <a class="header-anchor" href="#贡献指南" aria-label="Permalink to &quot;贡献指南&quot;"></a></h1><p>感谢你能够看到这里,本项目非常欢迎你的贡献!</p><h2 id="贡献方法" tabindex="-1">贡献方法 <a class="header-anchor" href="#贡献方法" aria-label="Permalink to &quot;贡献方法&quot;"></a></h2><p>如果你有代码或文档想要贡献,需要先了解以下内容。</p><ol><li>你要贡献什么类型的代码?(新扩展、修复 Bug、安全问题、项目框架优化、文档</li><li>如果你贡献了新文件或新片段,你的代码是否经过 <code>php-cs-fixer</code> 和 <code>phpstan</code> 的检查?</li><li>在贡献代码前是否充分阅读了 <a href="./../develop/">开发指南</a></li></ol><p>如果你可以回答以上问题,并已经对代码做出了修改,可以及时在项目 GitHub 仓库发起 Pull Request。待代码审查完毕后可根据建议修改代码或直接合并到主分支。</p><h2 id="贡献类型" tabindex="-1">贡献类型 <a class="header-anchor" href="#贡献类型" aria-label="Permalink to &quot;贡献类型&quot;"></a></h2><p>本项目主要用途是编译静态链接的 PHP 二进制,基于 <code>symfony/console</code> 编写了命令行处理功能。在开发之前,如果你对它不够熟悉, 可以先查看 <a href="https://symfony.com/doc/current/components/console.html" target="_blank" rel="noreferrer">symfony/console 文档</a>。</p><h3 id="安全问题" tabindex="-1">安全问题 <a class="header-anchor" href="#安全问题" aria-label="Permalink to &quot;安全问题&quot;"></a></h3><p>因为本项目基本上是属于本地运行的 PHP 项目,一般来说不会存在远程攻击行为。但如果你发现了此类问题,请<strong>不要</strong>在 GitHub 仓库提交 PR 或 Issue 你需要通过 <a href="mailto:admin@zhamao.me" target="_blank" rel="noreferrer">邮件</a> 的方式联系项目维护者crazywhalecc。</p><h3 id="修复-bug" tabindex="-1">修复 Bug <a class="header-anchor" href="#修复-bug" aria-label="Permalink to &quot;修复 Bug&quot;"></a></h3><p>修复 Bug 一般不涉及项目结构和框架的修改,所以如果你可以定位到错误代码并直接修复它,请直接提交 PR。</p><h3 id="新扩展" tabindex="-1">新扩展 <a class="header-anchor" href="#新扩展" aria-label="Permalink to &quot;新扩展&quot;"></a></h3><p>对于添加一个新扩展来说,你需要先了解一些本项目的基本结构,以及如何根据现有的逻辑添加新扩展。在本页的下一章节将会详细介绍。 总的来说,你需要:</p><ol><li>评估扩展是否可以内联编译到 PHP 中。</li><li>评估扩展的依赖库(如果有)是否可以静态编译。</li><li>写出扩展的依赖库在不同平台编译命令。</li><li>验证扩展及其依赖库能否与现有扩展和依赖库兼容。</li><li>验证扩展在 <code>cli</code>、<code>micro</code>、<code>fpm</code>、<code>embed</code> 几种 SAPI 中均正常工作。</li><li>编写文档,加入你的扩展。</li></ol><h3 id="项目框架优化" tabindex="-1">项目框架优化 <a class="header-anchor" href="#项目框架优化" aria-label="Permalink to &quot;项目框架优化&quot;"></a></h3><p>如果你已经熟悉 <code>symfony/console</code> 的工作原理,并同时要对项目的框架进行一些修改或优化,请先了解以下事情:</p><ol><li>加入扩展不属于项目框架优化,但如果你在加入新的扩展时发现不得不优化框架,则需先对框架本身进行修改,然后再加入扩展。</li><li>对于一些大规模逻辑修改(例如涉及 LibraryBase、Extension 对象等的修改)时,建议先提交 Issue 或 Draft PR 进行讨论方案。</li><li>项目早期为纯中文开发项目,代码中存在一部分中文的注释。国际化项目后你可以提交 PR 将这些注释翻译为英语。</li><li>请不要在代码中提交包含较多无用的代码片段,例如大量未被使用的变量、方法、类、重复写了很多次的代码。</li></ol>',18),r=[t];function n(c,d,s,h,p,u){return o(),a("div",null,r)}const f=e(l,[["render",n]]);export{_ as __pageData,f as default};
import{_ as e,c as a,o,a1 as i}from"./chunks/framework.gjrnbxUT.js";const _=JSON.parse('{"title":"贡献指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/contributing/index.md","filePath":"zh/contributing/index.md"}'),l={name:"zh/contributing/index.md"},t=i('<h1 id="贡献指南" tabindex="-1">贡献指南 <a class="header-anchor" href="#贡献指南" aria-label="Permalink to &quot;贡献指南&quot;"></a></h1><p>感谢你能够看到这里,本项目非常欢迎你的贡献!</p><h2 id="贡献方法" tabindex="-1">贡献方法 <a class="header-anchor" href="#贡献方法" aria-label="Permalink to &quot;贡献方法&quot;"></a></h2><p>如果你有代码或文档想要贡献,需要先了解以下内容。</p><ol><li>你要贡献什么类型的代码?(新扩展、修复 Bug、安全问题、项目框架优化、文档</li><li>如果你贡献了新文件或新片段,你的代码是否经过 <code>php-cs-fixer</code> 和 <code>phpstan</code> 的检查?</li><li>在贡献代码前是否充分阅读了 <a href="./../develop/">开发指南</a></li></ol><p>如果你可以回答以上问题,并已经对代码做出了修改,可以及时在项目 GitHub 仓库发起 Pull Request。待代码审查完毕后可根据建议修改代码或直接合并到主分支。</p><h2 id="贡献类型" tabindex="-1">贡献类型 <a class="header-anchor" href="#贡献类型" aria-label="Permalink to &quot;贡献类型&quot;"></a></h2><p>本项目主要用途是编译静态链接的 PHP 二进制,基于 <code>symfony/console</code> 编写了命令行处理功能。在开发之前,如果你对它不够熟悉, 可以先查看 <a href="https://symfony.com/doc/current/components/console.html" target="_blank" rel="noreferrer">symfony/console 文档</a>。</p><h3 id="安全问题" tabindex="-1">安全问题 <a class="header-anchor" href="#安全问题" aria-label="Permalink to &quot;安全问题&quot;"></a></h3><p>因为本项目基本上是属于本地运行的 PHP 项目,一般来说不会存在远程攻击行为。但如果你发现了此类问题,请<strong>不要</strong>在 GitHub 仓库提交 PR 或 Issue 你需要通过 <a href="mailto:admin@zhamao.me" target="_blank" rel="noreferrer">邮件</a> 的方式联系项目维护者crazywhalecc。</p><h3 id="修复-bug" tabindex="-1">修复 Bug <a class="header-anchor" href="#修复-bug" aria-label="Permalink to &quot;修复 Bug&quot;"></a></h3><p>修复 Bug 一般不涉及项目结构和框架的修改,所以如果你可以定位到错误代码并直接修复它,请直接提交 PR。</p><h3 id="新扩展" tabindex="-1">新扩展 <a class="header-anchor" href="#新扩展" aria-label="Permalink to &quot;新扩展&quot;"></a></h3><p>对于添加一个新扩展来说,你需要先了解一些本项目的基本结构,以及如何根据现有的逻辑添加新扩展。在本页的下一章节将会详细介绍。 总的来说,你需要:</p><ol><li>评估扩展是否可以内联编译到 PHP 中。</li><li>评估扩展的依赖库(如果有)是否可以静态编译。</li><li>写出扩展的依赖库在不同平台编译命令。</li><li>验证扩展及其依赖库能否与现有扩展和依赖库兼容。</li><li>验证扩展在 <code>cli</code>、<code>micro</code>、<code>fpm</code>、<code>embed</code> 几种 SAPI 中均正常工作。</li><li>编写文档,加入你的扩展。</li></ol><h3 id="项目框架优化" tabindex="-1">项目框架优化 <a class="header-anchor" href="#项目框架优化" aria-label="Permalink to &quot;项目框架优化&quot;"></a></h3><p>如果你已经熟悉 <code>symfony/console</code> 的工作原理,并同时要对项目的框架进行一些修改或优化,请先了解以下事情:</p><ol><li>加入扩展不属于项目框架优化,但如果你在加入新的扩展时发现不得不优化框架,则需先对框架本身进行修改,然后再加入扩展。</li><li>对于一些大规模逻辑修改(例如涉及 LibraryBase、Extension 对象等的修改)时,建议先提交 Issue 或 Draft PR 进行讨论方案。</li><li>项目早期为纯中文开发项目,代码中存在一部分中文的注释。国际化项目后你可以提交 PR 将这些注释翻译为英语。</li><li>请不要在代码中提交包含较多无用的代码片段,例如大量未被使用的变量、方法、类、重复写了很多次的代码。</li></ol>',18),r=[t];function n(c,d,s,h,p,u){return o(),a("div",null,r)}const f=e(l,[["render",n]]);export{_ as __pageData,f as default};

View File

@ -1 +1 @@
import{_ as e,c as a,o,a1 as i}from"./chunks/framework.CszIUXhs.js";const _=JSON.parse('{"title":"贡献指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/contributing/index.md","filePath":"zh/contributing/index.md"}'),l={name:"zh/contributing/index.md"},t=i("",18),r=[t];function n(c,d,s,h,p,u){return o(),a("div",null,r)}const f=e(l,[["render",n]]);export{_ as __pageData,f as default};
import{_ as e,c as a,o,a1 as i}from"./chunks/framework.gjrnbxUT.js";const _=JSON.parse('{"title":"贡献指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/contributing/index.md","filePath":"zh/contributing/index.md"}'),l={name:"zh/contributing/index.md"},t=i("",18),r=[t];function n(c,d,s,h,p,u){return o(),a("div",null,r)}const f=e(l,[["render",n]]);export{_ as __pageData,f as default};

View File

@ -1,4 +1,4 @@
import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"Doctor 模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/doctor-module.md","filePath":"zh/develop/doctor-module.md"}'),h={name:"zh/develop/doctor-module.md"},l=n(`<h1 id="doctor-模块" tabindex="-1">Doctor 模块 <a class="header-anchor" href="#doctor-模块" aria-label="Permalink to &quot;Doctor 模块&quot;"></a></h1><p>Doctor 模块是一个较为独立的用于检查系统环境的模块,可使用命令 <code>bin/spc doctor</code> 进入,入口的命令类在 <code>DoctorCommand.php</code> 中。</p><p>Doctor 模块是一个检查单,里面有一系列的检查项目和自动修复项目。这些项目都存放在 <code>src/SPC/doctor/item/</code> 目录中, 并且使用了两种 Attribute 用作检查项标记和自动修复项目标记:<code>#[AsCheckItem]</code> 和 <code>#[AsFixItem]</code>。</p><p>以现有的检查项 <code>if necessary tools are installed</code>,它是用于检查编译必需的包是否安装在 macOS 系统内,下面是它的源码:</p><div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> SPC\\doctor\\AsCheckItem</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"Doctor 模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/doctor-module.md","filePath":"zh/develop/doctor-module.md"}'),h={name:"zh/develop/doctor-module.md"},l=n(`<h1 id="doctor-模块" tabindex="-1">Doctor 模块 <a class="header-anchor" href="#doctor-模块" aria-label="Permalink to &quot;Doctor 模块&quot;"></a></h1><p>Doctor 模块是一个较为独立的用于检查系统环境的模块,可使用命令 <code>bin/spc doctor</code> 进入,入口的命令类在 <code>DoctorCommand.php</code> 中。</p><p>Doctor 模块是一个检查单,里面有一系列的检查项目和自动修复项目。这些项目都存放在 <code>src/SPC/doctor/item/</code> 目录中, 并且使用了两种 Attribute 用作检查项标记和自动修复项目标记:<code>#[AsCheckItem]</code> 和 <code>#[AsFixItem]</code>。</p><p>以现有的检查项 <code>if necessary tools are installed</code>,它是用于检查编译必需的包是否安装在 macOS 系统内,下面是它的源码:</p><div class="language-php vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">php</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> SPC\\doctor\\AsCheckItem</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> SPC\\doctor\\AsFixItem</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">use</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> SPC\\doctor\\CheckResult</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"></span>

View File

@ -1 +1 @@
import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"Doctor 模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/doctor-module.md","filePath":"zh/develop/doctor-module.md"}'),h={name:"zh/develop/doctor-module.md"},l=n("",13),k=[l];function t(p,e,d,E,r,c){return a(),i("div",null,k)}const y=s(h,[["render",t]]);export{g as __pageData,y as default};
import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"Doctor 模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/doctor-module.md","filePath":"zh/develop/doctor-module.md"}'),h={name:"zh/develop/doctor-module.md"},l=n("",13),k=[l];function t(p,e,d,E,r,c){return a(),i("div",null,k)}const y=s(h,[["render",t]]);export{g as __pageData,y as default};

View File

@ -1 +1 @@
import{_ as e,c as a,o as t,a1 as o}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"开发简介","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/index.md","filePath":"zh/develop/index.md"}'),p={name:"zh/develop/index.md"},i=o('<h1 id="开发简介" tabindex="-1">开发简介 <a class="header-anchor" href="#开发简介" aria-label="Permalink to &quot;开发简介&quot;"></a></h1><p>开发本项目需要安装部署 PHP 环境,以及一些 PHP 项目常用的扩展和 Composer。</p><p>项目的开发环境和运行环境几乎完全一致,你可以参照 <strong>指南-本地构建</strong> 部分安装系统 PHP 或使用本项目预构建的静态 PHP 作为环境,这里不再赘述。</p><p>抛开用途,本项目本身其实就是一个 <code>php-cli</code> 程序,你可以将它当作一个正常的 PHP 项目进行编辑和开发,同时你需要了解不同系统的 Shell 命令行。</p><p>本项目目前的目的就是为了编译静态编译的独立 PHP但主体部分也包含编译很多依赖库的静态版本所以你可以复用这套编译逻辑用于构建其他程序的独立二进制版本例如 Nginx 等。</p><h2 id="环境准备" tabindex="-1">环境准备 <a class="header-anchor" href="#环境准备" aria-label="Permalink to &quot;环境准备&quot;"></a></h2><p>开发本项目需要 PHP 环境。你可以使用系统自带的 PHP也可以使用本项目构建的静态 PHP。</p><p>无论是使用哪种 PHP在开发环境你需要安装这些扩展</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter</span></span></code></pre></div><p>static-php-cli 项目本身不需要这么多扩展,但在开发过程中,你会用到 Composer、PHPUnit 等工具,它们需要这些扩展。</p><blockquote><p>对于 static-php-cli 自身构建的 micro 自执行二进制,仅需要 <code>pcntl,posix,mbstring,tokenizer,phar</code>。</p></blockquote><h2 id="开始开发" tabindex="-1">开始开发 <a class="header-anchor" href="#开始开发" aria-label="Permalink to &quot;开始开发&quot;"></a></h2><p>继续向下查看项目结构的文档,你可以从中了解 <code>static-php-cli</code> 是如何运作的。</p>',13),s=[i];function n(c,r,l,d,h,P){return t(),a("div",null,s)}const u=e(p,[["render",n]]);export{m as __pageData,u as default};
import{_ as e,c as a,o as t,a1 as o}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"开发简介","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/index.md","filePath":"zh/develop/index.md"}'),p={name:"zh/develop/index.md"},i=o('<h1 id="开发简介" tabindex="-1">开发简介 <a class="header-anchor" href="#开发简介" aria-label="Permalink to &quot;开发简介&quot;"></a></h1><p>开发本项目需要安装部署 PHP 环境,以及一些 PHP 项目常用的扩展和 Composer。</p><p>项目的开发环境和运行环境几乎完全一致,你可以参照 <strong>指南-本地构建</strong> 部分安装系统 PHP 或使用本项目预构建的静态 PHP 作为环境,这里不再赘述。</p><p>抛开用途,本项目本身其实就是一个 <code>php-cli</code> 程序,你可以将它当作一个正常的 PHP 项目进行编辑和开发,同时你需要了解不同系统的 Shell 命令行。</p><p>本项目目前的目的就是为了编译静态编译的独立 PHP但主体部分也包含编译很多依赖库的静态版本所以你可以复用这套编译逻辑用于构建其他程序的独立二进制版本例如 Nginx 等。</p><h2 id="环境准备" tabindex="-1">环境准备 <a class="header-anchor" href="#环境准备" aria-label="Permalink to &quot;环境准备&quot;"></a></h2><p>开发本项目需要 PHP 环境。你可以使用系统自带的 PHP也可以使用本项目构建的静态 PHP。</p><p>无论是使用哪种 PHP在开发环境你需要安装这些扩展</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>curl,dom,filter,mbstring,openssl,pcntl,phar,posix,sodium,tokenizer,xml,xmlwriter</span></span></code></pre></div><p>static-php-cli 项目本身不需要这么多扩展,但在开发过程中,你会用到 Composer、PHPUnit 等工具,它们需要这些扩展。</p><blockquote><p>对于 static-php-cli 自身构建的 micro 自执行二进制,仅需要 <code>pcntl,posix,mbstring,tokenizer,phar</code>。</p></blockquote><h2 id="开始开发" tabindex="-1">开始开发 <a class="header-anchor" href="#开始开发" aria-label="Permalink to &quot;开始开发&quot;"></a></h2><p>继续向下查看项目结构的文档,你可以从中了解 <code>static-php-cli</code> 是如何运作的。</p>',13),s=[i];function n(c,r,l,d,h,P){return t(),a("div",null,s)}const u=e(p,[["render",n]]);export{m as __pageData,u as default};

View File

@ -1 +1 @@
import{_ as e,c as a,o as t,a1 as o}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"开发简介","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/index.md","filePath":"zh/develop/index.md"}'),p={name:"zh/develop/index.md"},i=o("",13),s=[i];function n(c,r,l,d,h,P){return t(),a("div",null,s)}const u=e(p,[["render",n]]);export{m as __pageData,u as default};
import{_ as e,c as a,o as t,a1 as o}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"开发简介","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/index.md","filePath":"zh/develop/index.md"}'),p={name:"zh/develop/index.md"},i=o("",13),s=[i];function n(c,r,l,d,h,P){return t(),a("div",null,s)}const u=e(p,[["render",n]]);export{m as __pageData,u as default};

View File

@ -1 +1 @@
import{_ as i,c as a,o as e,a1 as l}from"./chunks/framework.CszIUXhs.js";const _=JSON.parse('{"title":"对 PHP 源码的修改","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/php-src-changes.md","filePath":"zh/develop/php-src-changes.md"}'),t={name:"zh/develop/php-src-changes.md"},c=l('<h1 id="对-php-源码的修改" tabindex="-1">对 PHP 源码的修改 <a class="header-anchor" href="#对-php-源码的修改" aria-label="Permalink to &quot;对 PHP 源码的修改&quot;"></a></h1><p>由于 static-php-cli 在静态编译过程中为了实现良好的兼容性、性能和安全性,对 PHP 源码进行了一些修改。下面是目前对 PHP 源码修改的说明。</p><h2 id="micro-相关补丁" tabindex="-1">micro 相关补丁 <a class="header-anchor" href="#micro-相关补丁" aria-label="Permalink to &quot;micro 相关补丁&quot;"></a></h2><p>基于 phpmicro 项目提供的补丁static-php-cli 对 PHP 源码进行了一些修改,以适应静态编译的需求。<a href="https://github.com/easysoft/phpmicro/tree/master/patches" target="_blank" rel="noreferrer">补丁列表</a> 包含:</p><p>目前 static-php-cli 在编译时用到的补丁有:</p><ul><li>static_opcache</li><li>static_extensions_win32</li><li>cli_checks</li><li>disable_huge_page</li><li>vcruntime140</li><li>win32</li><li>zend_stream</li><li>cli_static</li><li>macos_iconv</li><li>phar</li></ul><h2 id="php-8-1-libxml-补丁" tabindex="-1">PHP &lt;= 8.1 libxml 补丁 <a class="header-anchor" href="#php-8-1-libxml-补丁" aria-label="Permalink to &quot;PHP &lt;= 8.1 libxml 补丁&quot;"></a></h2><p>因为 PHP 官方仅对 8.1 进行安全更新,旧版本停止更新,所以 static-php-cli 对 PHP 8.1 及以下版本应用了在新版本 PHP 中已经应用的 libxml 编译补丁。</p><h2 id="gd-扩展-windows-补丁" tabindex="-1">gd 扩展 Windows 补丁 <a class="header-anchor" href="#gd-扩展-windows-补丁" aria-label="Permalink to &quot;gd 扩展 Windows 补丁&quot;"></a></h2><p>在 Windows 下编译 gd 扩展需要大幅改动 <code>config.w32</code> 文件static-php-cli 对 gd 扩展进行了一些修改,使其在 Windows 下编译更加方便。</p><h2 id="yaml-扩展-windows-补丁" tabindex="-1">yaml 扩展 Windows 补丁 <a class="header-anchor" href="#yaml-扩展-windows-补丁" aria-label="Permalink to &quot;yaml 扩展 Windows 补丁&quot;"></a></h2><p>yaml 扩展在 Windows 下编译需要修改 <code>config.w32</code> 文件static-php-cli 对 yaml 扩展进行了一些修改,使其在 Windows 下编译更加方便。</p><h2 id="static-php-cli-版本信息插入" tabindex="-1">static-php-cli 版本信息插入 <a class="header-anchor" href="#static-php-cli-版本信息插入" aria-label="Permalink to &quot;static-php-cli 版本信息插入&quot;"></a></h2><p>static-php-cli 在编译时会在 PHP 版本信息中插入 static-php-cli 的版本信息,以便于识别。</p><h2 id="加入硬编码-ini-的选项" tabindex="-1">加入硬编码 INI 的选项 <a class="header-anchor" href="#加入硬编码-ini-的选项" aria-label="Permalink to &quot;加入硬编码 INI 的选项&quot;"></a></h2><p>在使用 <code>-I</code> 参数硬编码 INI 到静态 PHP 的功能中static-php-cli 会修改 PHP 源码以插入硬编码内容。</p><h2 id="linux-系统修复补丁" tabindex="-1">Linux 系统修复补丁 <a class="header-anchor" href="#linux-系统修复补丁" aria-label="Permalink to &quot;Linux 系统修复补丁&quot;"></a></h2><p>部分编译环境可能缺少一些头文件或库static-php-cli 会在编译时自动修复这些问题,如:</p><ul><li>HAVE_STRLCAT missing problem</li><li>HAVE_STRLCPY missing problem</li></ul><h2 id="windows-系统下-fiber-问题修复补丁" tabindex="-1">Windows 系统下 Fiber 问题修复补丁 <a class="header-anchor" href="#windows-系统下-fiber-问题修复补丁" aria-label="Permalink to &quot;Windows 系统下 Fiber 问题修复补丁&quot;"></a></h2><p>在 Windows 下编译 PHP 时Fiber 扩展会出现一些问题static-php-cli 会在编译时自动修复这些问题(修改 php-src 的 <code>config.w32</code>)。</p>',21),o=[c];function s(r,p,h,n,d,m){return e(),a("div",null,o)}const u=i(t,[["render",s]]);export{_ as __pageData,u as default};
import{_ as i,c as a,o as e,a1 as l}from"./chunks/framework.gjrnbxUT.js";const _=JSON.parse('{"title":"对 PHP 源码的修改","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/php-src-changes.md","filePath":"zh/develop/php-src-changes.md"}'),t={name:"zh/develop/php-src-changes.md"},c=l('<h1 id="对-php-源码的修改" tabindex="-1">对 PHP 源码的修改 <a class="header-anchor" href="#对-php-源码的修改" aria-label="Permalink to &quot;对 PHP 源码的修改&quot;"></a></h1><p>由于 static-php-cli 在静态编译过程中为了实现良好的兼容性、性能和安全性,对 PHP 源码进行了一些修改。下面是目前对 PHP 源码修改的说明。</p><h2 id="micro-相关补丁" tabindex="-1">micro 相关补丁 <a class="header-anchor" href="#micro-相关补丁" aria-label="Permalink to &quot;micro 相关补丁&quot;"></a></h2><p>基于 phpmicro 项目提供的补丁static-php-cli 对 PHP 源码进行了一些修改,以适应静态编译的需求。<a href="https://github.com/easysoft/phpmicro/tree/master/patches" target="_blank" rel="noreferrer">补丁列表</a> 包含:</p><p>目前 static-php-cli 在编译时用到的补丁有:</p><ul><li>static_opcache</li><li>static_extensions_win32</li><li>cli_checks</li><li>disable_huge_page</li><li>vcruntime140</li><li>win32</li><li>zend_stream</li><li>cli_static</li><li>macos_iconv</li><li>phar</li></ul><h2 id="php-8-1-libxml-补丁" tabindex="-1">PHP &lt;= 8.1 libxml 补丁 <a class="header-anchor" href="#php-8-1-libxml-补丁" aria-label="Permalink to &quot;PHP &lt;= 8.1 libxml 补丁&quot;"></a></h2><p>因为 PHP 官方仅对 8.1 进行安全更新,旧版本停止更新,所以 static-php-cli 对 PHP 8.1 及以下版本应用了在新版本 PHP 中已经应用的 libxml 编译补丁。</p><h2 id="gd-扩展-windows-补丁" tabindex="-1">gd 扩展 Windows 补丁 <a class="header-anchor" href="#gd-扩展-windows-补丁" aria-label="Permalink to &quot;gd 扩展 Windows 补丁&quot;"></a></h2><p>在 Windows 下编译 gd 扩展需要大幅改动 <code>config.w32</code> 文件static-php-cli 对 gd 扩展进行了一些修改,使其在 Windows 下编译更加方便。</p><h2 id="yaml-扩展-windows-补丁" tabindex="-1">yaml 扩展 Windows 补丁 <a class="header-anchor" href="#yaml-扩展-windows-补丁" aria-label="Permalink to &quot;yaml 扩展 Windows 补丁&quot;"></a></h2><p>yaml 扩展在 Windows 下编译需要修改 <code>config.w32</code> 文件static-php-cli 对 yaml 扩展进行了一些修改,使其在 Windows 下编译更加方便。</p><h2 id="static-php-cli-版本信息插入" tabindex="-1">static-php-cli 版本信息插入 <a class="header-anchor" href="#static-php-cli-版本信息插入" aria-label="Permalink to &quot;static-php-cli 版本信息插入&quot;"></a></h2><p>static-php-cli 在编译时会在 PHP 版本信息中插入 static-php-cli 的版本信息,以便于识别。</p><h2 id="加入硬编码-ini-的选项" tabindex="-1">加入硬编码 INI 的选项 <a class="header-anchor" href="#加入硬编码-ini-的选项" aria-label="Permalink to &quot;加入硬编码 INI 的选项&quot;"></a></h2><p>在使用 <code>-I</code> 参数硬编码 INI 到静态 PHP 的功能中static-php-cli 会修改 PHP 源码以插入硬编码内容。</p><h2 id="linux-系统修复补丁" tabindex="-1">Linux 系统修复补丁 <a class="header-anchor" href="#linux-系统修复补丁" aria-label="Permalink to &quot;Linux 系统修复补丁&quot;"></a></h2><p>部分编译环境可能缺少一些头文件或库static-php-cli 会在编译时自动修复这些问题,如:</p><ul><li>HAVE_STRLCAT missing problem</li><li>HAVE_STRLCPY missing problem</li></ul><h2 id="windows-系统下-fiber-问题修复补丁" tabindex="-1">Windows 系统下 Fiber 问题修复补丁 <a class="header-anchor" href="#windows-系统下-fiber-问题修复补丁" aria-label="Permalink to &quot;Windows 系统下 Fiber 问题修复补丁&quot;"></a></h2><p>在 Windows 下编译 PHP 时Fiber 扩展会出现一些问题static-php-cli 会在编译时自动修复这些问题(修改 php-src 的 <code>config.w32</code>)。</p>',21),o=[c];function s(r,p,h,n,d,m){return e(),a("div",null,o)}const u=i(t,[["render",s]]);export{_ as __pageData,u as default};

View File

@ -1 +1 @@
import{_ as i,c as a,o as e,a1 as l}from"./chunks/framework.CszIUXhs.js";const _=JSON.parse('{"title":"对 PHP 源码的修改","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/php-src-changes.md","filePath":"zh/develop/php-src-changes.md"}'),t={name:"zh/develop/php-src-changes.md"},c=l("",21),o=[c];function s(r,p,h,n,d,m){return e(),a("div",null,o)}const u=i(t,[["render",s]]);export{_ as __pageData,u as default};
import{_ as i,c as a,o as e,a1 as l}from"./chunks/framework.gjrnbxUT.js";const _=JSON.parse('{"title":"对 PHP 源码的修改","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/php-src-changes.md","filePath":"zh/develop/php-src-changes.md"}'),t={name:"zh/develop/php-src-changes.md"},c=l("",21),o=[c];function s(r,p,h,n,d,m){return e(),a("div",null,o)}const u=i(t,[["render",s]]);export{_ as __pageData,u as default};

View File

@ -1,4 +1,4 @@
import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"资源模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/source-module.md","filePath":"zh/develop/source-module.md"}'),n={name:"zh/develop/source-module.md"},l=t(`<h1 id="资源模块" tabindex="-1">资源模块 <a class="header-anchor" href="#资源模块" aria-label="Permalink to &quot;资源模块&quot;"></a></h1><p>static-php-cli 的下载资源模块是一个主要的功能它包含了所依赖的库、外部扩展、PHP 源码的下载方式和资源解压方式。 下载的配置文件主要涉及 <code>source.json</code> 和 <code>pkg.json</code> 文件,这个文件记录了所有可下载的资源的下载方式。</p><p>下载功能主要涉及的命令有 <code>bin/spc download</code> 和 <code>bin/spc extract</code>。其中 <code>download</code> 命令是一个下载器,它会根据配置文件下载资源; <code>extract</code> 命令是一个解压器,它会根据配置文件解压资源。</p><p>一般来说下载资源可能会比较慢因为这些资源来源于各个官网、GitHub 等不同位置,同时它们也占用了较大空间,所以你可以在一次下载资源后,可重复使用。</p><p>下载器的配置文件是 <code>source.json</code>,它包含了所有资源的下载方式,你可以在其中添加你需要的资源下载方式,也可以修改已有的资源下载方式。</p><p>每个资源的下载配置结构如下,下面是 <code>libevent</code> 扩展对应的资源下载配置:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"资源模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/source-module.md","filePath":"zh/develop/source-module.md"}'),n={name:"zh/develop/source-module.md"},l=t(`<h1 id="资源模块" tabindex="-1">资源模块 <a class="header-anchor" href="#资源模块" aria-label="Permalink to &quot;资源模块&quot;"></a></h1><p>static-php-cli 的下载资源模块是一个主要的功能它包含了所依赖的库、外部扩展、PHP 源码的下载方式和资源解压方式。 下载的配置文件主要涉及 <code>source.json</code> 和 <code>pkg.json</code> 文件,这个文件记录了所有可下载的资源的下载方式。</p><p>下载功能主要涉及的命令有 <code>bin/spc download</code> 和 <code>bin/spc extract</code>。其中 <code>download</code> 命令是一个下载器,它会根据配置文件下载资源; <code>extract</code> 命令是一个解压器,它会根据配置文件解压资源。</p><p>一般来说下载资源可能会比较慢因为这些资源来源于各个官网、GitHub 等不同位置,同时它们也占用了较大空间,所以你可以在一次下载资源后,可重复使用。</p><p>下载器的配置文件是 <code>source.json</code>,它包含了所有资源的下载方式,你可以在其中添加你需要的资源下载方式,也可以修改已有的资源下载方式。</p><p>每个资源的下载配置结构如下,下面是 <code>libevent</code> 扩展对应的资源下载配置:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;libevent&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;type&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;ghrel&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;repo&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;libevent/libevent&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>

View File

@ -1 +1 @@
import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"资源模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/source-module.md","filePath":"zh/develop/source-module.md"}'),n={name:"zh/develop/source-module.md"},l=t("",75),p=[l];function h(e,k,o,E,d,r){return a(),i("div",null,p)}const u=s(n,[["render",h]]);export{g as __pageData,u as default};
import{_ as s,c as i,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"资源模块","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/source-module.md","filePath":"zh/develop/source-module.md"}'),n={name:"zh/develop/source-module.md"},l=t("",75),p=[l];function h(e,k,o,E,d,r){return a(),i("div",null,p)}const u=s(n,[["render",h]]);export{g as __pageData,u as default};

View File

@ -1 +1 @@
import{_ as e,c as o,o as c,a1 as d}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"项目结构简介","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/structure.md","filePath":"zh/develop/structure.md"}'),a={name:"zh/develop/structure.md"},t=d("",49),p=[t];function r(s,l,i,n,h,m){return c(),o("div",null,p)}const b=e(a,[["render",r]]);export{u as __pageData,b as default};
import{_ as e,c as o,o as c,a1 as d}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"项目结构简介","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/structure.md","filePath":"zh/develop/structure.md"}'),a={name:"zh/develop/structure.md"},t=d("",49),p=[t];function r(s,l,i,n,h,m){return c(),o("div",null,p)}const b=e(a,[["render",r]]);export{u as __pageData,b as default};

View File

@ -1 +1 @@
import{_ as s,c as i,o as a,a1 as l}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"系统编译工具","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/system-build-tools.md","filePath":"zh/develop/system-build-tools.md"}'),n={name:"zh/develop/system-build-tools.md"},p=l("",50),e=[p];function h(t,k,c,d,o,r){return a(),i("div",null,e)}const F=s(n,[["render",h]]);export{g as __pageData,F as default};
import{_ as s,c as i,o as a,a1 as l}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"系统编译工具","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/system-build-tools.md","filePath":"zh/develop/system-build-tools.md"}'),n={name:"zh/develop/system-build-tools.md"},p=l("",50),e=[p];function h(t,k,c,d,o,r){return a(),i("div",null,e)}const F=s(n,[["render",h]]);export{g as __pageData,F as default};

View File

@ -1,2 +1,2 @@
import{_ as e,c as a,o,a1 as i}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq/index.md","filePath":"zh/faq/index.md"}'),s={name:"zh/faq/index.md"},c=i(`<h1 id="常见问题" tabindex="-1">常见问题 <a class="header-anchor" href="#常见问题" aria-label="Permalink to &quot;常见问题&quot;"></a></h1><p>这里将会编写一些你容易遇到的问题。目前有很多,但是我需要花时间来整理一下。</p><h2 id="静态编译的-php-可以安装扩展吗" tabindex="-1">静态编译的 PHP 可以安装扩展吗 <a class="header-anchor" href="#静态编译的-php-可以安装扩展吗" aria-label="Permalink to &quot;静态编译的 PHP 可以安装扩展吗&quot;"></a></h2><p>因为传统架构下的 PHP 安装扩展的原理是使用 <code>.so</code> 类型的动态链接的库方式安装新扩展,而使用本项目编译的静态链接的 PHP 无法<strong>直接</strong>使用动态链接库安装新扩展。</p><p>对于 macOS 平台来说macOS 下的几乎所有二进制文件都无法真正纯静态链接,几乎所有二进制文件都会链接 macOS 的系统库:<code>/usr/lib/libresolv.9.dylib</code> 和 <code>/usr/lib/libSystem.B.dylib</code>。 所以在 macOS 系统下,在特定的编译条件下可以使用静态编译的 php 二进制文件,同时使用动态链接的扩展:</p><ol><li>使用 <code>--no-strip</code> 参数,将不会对二进制文件去除调试符号等信息,以供使用 <code>Xdebug</code> 等外部 Zend 扩展。</li><li>如果要编译某些 Zend 扩展,使用 Homebrew、MacPorts、源码编译的形式在所在的操作系统安装一个普通版本的 PHP。</li><li>使用 <code>phpize &amp;&amp; ./configure &amp;&amp; make</code> 命令编译想要使用的扩展。</li><li>将扩展文件 <code>xxxx.so</code> 拷贝到外部,使用静态编译的 PHP 二进制,例如使用 Xdebug 扩展:<code>cd buildroot/bin/ &amp;&amp; ./php -d &quot;zend_extension=/path/to/xdebug.so&quot;</code>。</li></ol><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</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;"># 构建静态 php-cli</span></span>
import{_ as e,c as a,o,a1 as i}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq/index.md","filePath":"zh/faq/index.md"}'),s={name:"zh/faq/index.md"},c=i(`<h1 id="常见问题" tabindex="-1">常见问题 <a class="header-anchor" href="#常见问题" aria-label="Permalink to &quot;常见问题&quot;"></a></h1><p>这里将会编写一些你容易遇到的问题。目前有很多,但是我需要花时间来整理一下。</p><h2 id="静态编译的-php-可以安装扩展吗" tabindex="-1">静态编译的 PHP 可以安装扩展吗 <a class="header-anchor" href="#静态编译的-php-可以安装扩展吗" aria-label="Permalink to &quot;静态编译的 PHP 可以安装扩展吗&quot;"></a></h2><p>因为传统架构下的 PHP 安装扩展的原理是使用 <code>.so</code> 类型的动态链接的库方式安装新扩展,而使用本项目编译的静态链接的 PHP 无法<strong>直接</strong>使用动态链接库安装新扩展。</p><p>对于 macOS 平台来说macOS 下的几乎所有二进制文件都无法真正纯静态链接,几乎所有二进制文件都会链接 macOS 的系统库:<code>/usr/lib/libresolv.9.dylib</code> 和 <code>/usr/lib/libSystem.B.dylib</code>。 所以在 macOS 系统下,在特定的编译条件下可以使用静态编译的 php 二进制文件,同时使用动态链接的扩展:</p><ol><li>使用 <code>--no-strip</code> 参数,将不会对二进制文件去除调试符号等信息,以供使用 <code>Xdebug</code> 等外部 Zend 扩展。</li><li>如果要编译某些 Zend 扩展,使用 Homebrew、MacPorts、源码编译的形式在所在的操作系统安装一个普通版本的 PHP。</li><li>使用 <code>phpize &amp;&amp; ./configure &amp;&amp; make</code> 命令编译想要使用的扩展。</li><li>将扩展文件 <code>xxxx.so</code> 拷贝到外部,使用静态编译的 PHP 二进制,例如使用 Xdebug 扩展:<code>cd buildroot/bin/ &amp;&amp; ./php -d &quot;zend_extension=/path/to/xdebug.so&quot;</code>。</li></ol><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</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;"># 构建静态 php-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;"> ffi</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build-cli</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --no-strip</span></span></code></pre></div><p> Linux 使</p><h2 id="-oracle-" tabindex="-1"> Oracle <a class="header-anchor" href="#-oracle-" aria-label="Permalink to &quot; Oracle &quot;"></a></h2><p> <code>oci8</code><code>sourceguardian</code> <code>.a</code><code>.so</code> 使 static-php-cli macOS 使</p><p>使 <a href="https://github.com/crazywhalecc/static-php-cli/discussions/58" target="_blank" rel="noreferrer">standalone-php-cli</a> </p><h2 id="-windows-" tabindex="-1"> Windows <a class="header-anchor" href="#-windows-" aria-label="Permalink to &quot; Windows &quot;"></a></h2><p> WindowsWindows </p><ol><li>Windows *nix 使使</li><li>Windows 使</li></ol><h2 id="使-micro-" tabindex="-1">使 micro <a class="header-anchor" href="#使-micro-" aria-label="Permalink to &quot;使 micro &quot;"></a></h2><p>micro.sfx php php PHP php-src PHP PHP BPCBinary PHP Compiler PHP </p><p></p><p>static-php-clilwmbsswoole-cli php-src 便 phpmicro PHP sapi PHP PHP 使 Swoole CompilerSource Guardian </p><h2 id="使-ssl" tabindex="-1">使 ssl <a class="header-anchor" href="#使-ssl" aria-label="Permalink to &quot;使 ssl&quot;"></a></h2><p>使 curlpgsql HTTPS SSL <code>error:80000002:system library::No such file or directory</code> PHP <code>php.ini</code> <code>openssl.cafile</code> </p><p>使 PHP <code>php.ini</code> INI <code>openssl.cafile=/path/to/your-cert.pem</code> </p><p> Linux curl <a href="https://curl.se/docs/caextract.html" target="_blank" rel="noreferrer">cacert.pem</a> 使 <a href="https://go.dev/src/crypto/x509/root_linux.go" target="_blank" rel="noreferrer">Go </a></p><blockquote><p>INI <code>openssl.cafile</code> 使 <code>ini_set()</code> <code>openssl.cafile</code> <code>PHP_INI_SYSTEM</code> <code>php.ini</code> </p></blockquote>`,23),l=[c];function r(t,p,d,n,h,u){return o(),a("div",null,l)}const b=e(s,[["render",r]]);export{m as __pageData,b as default};

View File

@ -1 +1 @@
import{_ as e,c as a,o,a1 as i}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq/index.md","filePath":"zh/faq/index.md"}'),s={name:"zh/faq/index.md"},c=i("",23),l=[c];function r(t,p,d,n,h,u){return o(),a("div",null,l)}const b=e(s,[["render",r]]);export{m as __pageData,b as default};
import{_ as e,c as a,o,a1 as i}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq/index.md","filePath":"zh/faq/index.md"}'),s={name:"zh/faq/index.md"},c=i("",23),l=[c];function r(t,p,d,n,h,u){return o(),a("div",null,l)}const b=e(s,[["render",r]]);export{m as __pageData,b as default};

View File

@ -1 +1 @@
import{_ as t,c as e,o,a1 as a}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"Action 构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/action-build.md","filePath":"zh/guide/action-build.md"}'),i={name:"zh/guide/action-build.md"},c=a('<h1 id="action-构建" tabindex="-1">Action 构建 <a class="header-anchor" href="#action-构建" aria-label="Permalink to &quot;Action 构建&quot;"></a></h1><p>Action 构建指的是直接使用 GitHub Action 进行编译。</p><p>如果你不想自行编译,可以从本项目现有的 Action 下载 Artifact也可以从自托管的服务器下载<a href="https://dl.static-php.dev/static-php-cli/common/" target="_blank" rel="noreferrer">进入</a></p><blockquote><p>自托管的二进制也是由 Action 构建而来,<a href="https://github.com/static-php/static-php-cli-hosted" target="_blank" rel="noreferrer">项目仓库地址</a>。</p></blockquote><h2 id="构建方法" tabindex="-1">构建方法 <a class="header-anchor" href="#构建方法" aria-label="Permalink to &quot;构建方法&quot;"></a></h2><p>使用 GitHub Action 可以方便地构建一个静态编译的 PHP 和 phpmicro同时可以自行定义要编译的扩展。</p><ol><li>Fork 本项目。</li><li>进入项目的 Actions选择 CI 开头的 Workflow根据你需要的操作系统选择。</li><li>选择 <code>Run workflow</code>,填入你要编译的 PHP 版本、目标类型、扩展列表。(扩展列表使用英文逗号分割,例如 <code>bcmath,curl,mbstring</code></li><li>等待大约一段时间后,进入对应的任务中,获取 <code>Artifacts</code>。</li></ol><p>如果你选择了 <code>debug</code>,则会在构建时输出所有日志,包括编译的日志,以供排查错误。</p><blockquote><p>如果你需要在其他环境构建,可以使用 <a href="./manual-build.html">手动构建</a>。</p></blockquote><h2 id="扩展选择" tabindex="-1">扩展选择 <a class="header-anchor" href="#扩展选择" aria-label="Permalink to &quot;扩展选择&quot;"></a></h2><p>你可以到 <a href="./extensions.html">扩展列表</a> 中查看目前你需要的扩展是否均支持, 然后到 <a href="./cli-generator.html">在线命令生成</a> 中选择你需要编译的扩展,复制扩展字符串到 Action 的 <code>extensions</code> 中,编译即可。</p>',11),r=[c];function n(l,d,h,s,p,u){return o(),e("div",null,r)}const f=t(i,[["render",n]]);export{b as __pageData,f as default};
import{_ as t,c as e,o,a1 as a}from"./chunks/framework.gjrnbxUT.js";const b=JSON.parse('{"title":"Action 构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/action-build.md","filePath":"zh/guide/action-build.md"}'),i={name:"zh/guide/action-build.md"},c=a('<h1 id="action-构建" tabindex="-1">Action 构建 <a class="header-anchor" href="#action-构建" aria-label="Permalink to &quot;Action 构建&quot;"></a></h1><p>Action 构建指的是直接使用 GitHub Action 进行编译。</p><p>如果你不想自行编译,可以从本项目现有的 Action 下载 Artifact也可以从自托管的服务器下载<a href="https://dl.static-php.dev/static-php-cli/common/" target="_blank" rel="noreferrer">进入</a></p><blockquote><p>自托管的二进制也是由 Action 构建而来,<a href="https://github.com/static-php/static-php-cli-hosted" target="_blank" rel="noreferrer">项目仓库地址</a>。</p></blockquote><h2 id="构建方法" tabindex="-1">构建方法 <a class="header-anchor" href="#构建方法" aria-label="Permalink to &quot;构建方法&quot;"></a></h2><p>使用 GitHub Action 可以方便地构建一个静态编译的 PHP 和 phpmicro同时可以自行定义要编译的扩展。</p><ol><li>Fork 本项目。</li><li>进入项目的 Actions选择 CI 开头的 Workflow根据你需要的操作系统选择。</li><li>选择 <code>Run workflow</code>,填入你要编译的 PHP 版本、目标类型、扩展列表。(扩展列表使用英文逗号分割,例如 <code>bcmath,curl,mbstring</code></li><li>等待大约一段时间后,进入对应的任务中,获取 <code>Artifacts</code>。</li></ol><p>如果你选择了 <code>debug</code>,则会在构建时输出所有日志,包括编译的日志,以供排查错误。</p><blockquote><p>如果你需要在其他环境构建,可以使用 <a href="./manual-build.html">手动构建</a>。</p></blockquote><h2 id="扩展选择" tabindex="-1">扩展选择 <a class="header-anchor" href="#扩展选择" aria-label="Permalink to &quot;扩展选择&quot;"></a></h2><p>你可以到 <a href="./extensions.html">扩展列表</a> 中查看目前你需要的扩展是否均支持, 然后到 <a href="./cli-generator.html">在线命令生成</a> 中选择你需要编译的扩展,复制扩展字符串到 Action 的 <code>extensions</code> 中,编译即可。</p>',11),r=[c];function n(l,d,h,s,p,u){return o(),e("div",null,r)}const f=t(i,[["render",n]]);export{b as __pageData,f as default};

View File

@ -1 +1 @@
import{_ as t,c as e,o,a1 as a}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"Action 构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/action-build.md","filePath":"zh/guide/action-build.md"}'),i={name:"zh/guide/action-build.md"},c=a("",11),r=[c];function n(l,d,h,s,p,u){return o(),e("div",null,r)}const f=t(i,[["render",n]]);export{b as __pageData,f as default};
import{_ as t,c as e,o,a1 as a}from"./chunks/framework.gjrnbxUT.js";const b=JSON.parse('{"title":"Action 构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/action-build.md","filePath":"zh/guide/action-build.md"}'),i={name:"zh/guide/action-build.md"},c=a("",11),r=[c];function n(l,d,h,s,p,u){return o(),e("div",null,r)}const f=t(i,[["render",n]]);export{b as __pageData,f as default};

View File

@ -1,4 +1,4 @@
import{_ as i,c as s,o as a,a1 as e}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"在 Windows 上构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/build-on-windows.md","filePath":"zh/guide/build-on-windows.md"}'),l={name:"zh/guide/build-on-windows.md"},t=e(`<h1 id="在-windows-上构建" tabindex="-1">在 Windows 上构建 <a class="header-anchor" href="#在-windows-上构建" aria-label="Permalink to &quot;在 Windows 上构建&quot;"></a></h1><p>因为 Windows 系统是 NT 内核,与类 Unix 的操作系统使用的编译工具及操作系统接口几乎完全不同,所以在 Windows 上的构建流程会与 Unix 系统有些许不同。</p><h2 id="github-actions-构建" tabindex="-1">GitHub Actions 构建 <a class="header-anchor" href="#github-actions-构建" aria-label="Permalink to &quot;GitHub Actions 构建&quot;"></a></h2><p>现在已支持从 Actions 构建 Windows 版本的 static-php 了。 和 Linux、macOS 一样,你需要先 Fork static-php-cli 仓库到你的 GitHub 账户中,然后你可以进入 <a href="./extensions.html">扩展列表</a> 选择要编译的扩展,然后进入自己仓库的 <code>CI on Windows</code> 选择 PHP 版本、填入扩展列表(逗号分割),点击 Run 即可。</p><p>如果你要在本地开发或构建,请继续向下阅读。</p><h2 id="环境准备" tabindex="-1">环境准备 <a class="header-anchor" href="#环境准备" aria-label="Permalink to &quot;环境准备&quot;"></a></h2><p>在 Windows 上构建静态 PHP 所需要的工具与 PHP 官方的 Windows 构建工具是相同的。你可以阅读 <a href="https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2" target="_blank" rel="noreferrer">官方文档</a>。</p><p>总结下来,你需要以下环境及工具:</p><ul><li>Windows 10需要 build 17063 或以后的更新)</li><li>Visual Studio 2019/2022推荐 2022</li><li>Visual Studio 的 C++ 桌面开发</li><li>Git for Windows</li><li>static-php-cli 仓库</li><li>PHP 和 Composerstatic-php-cli 需要它们,可使用 <code>bin/setup-runtime</code> 自动安装)</li><li><a href="https://github.com/php/php-sdk-binary-tools" target="_blank" rel="noreferrer">php-sdk-binary-tools</a>(可使用 doctor 自动安装)</li><li>strawberry-perl可使用 doctor 自动安装)</li><li>nasm可使用 doctor 自动安装)</li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>static-php-cli 在 Windows 上的构建指的是使用 MSVC 构建 PHP不基于 MinGW、Cygwin、WSL 等环境。</p><p>如果你更倾向使用 WSL请参考在 Linux 上构建的章节。</p></div><p>在安装 Visual Studio 后,选择 C++ 桌面开发的工作负荷后,可能会下载 8GB 左右的编译工具,下载速度取决于你的网络状况。</p><h3 id="安装-git" tabindex="-1">安装 Git <a class="header-anchor" href="#安装-git" aria-label="Permalink to &quot;安装 Git&quot;"></a></h3><p>Git for Windows 可以从 <a href="https://git-scm.com/download/win" target="_blank" rel="noreferrer">这里</a> 下载并安装 <code>Standalone Installer 64-bit</code> 版本,安装在默认位置(<code>C:\\Program Files\\Git\\</code>)。 如果不想手动下载和安装,你也可以使用 Visual Studio Installer在<strong>单个组件</strong>的选择列表中,勾选 Git。</p><h3 id="准备-static-php-cli" tabindex="-1">准备 static-php-cli <a class="header-anchor" href="#准备-static-php-cli" aria-label="Permalink to &quot;准备 static-php-cli&quot;"></a></h3><p>static-php-cli 项目的下载方式很简单,只需要使用 git clone 即可。推荐将项目放在 <code>C:\\spc-build\\</code> 或类似目录,路径最好不要有空格。</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;">mkdir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;C:\\spc-build&quot;</span></span>
import{_ as i,c as s,o as a,a1 as e}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"在 Windows 上构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/build-on-windows.md","filePath":"zh/guide/build-on-windows.md"}'),l={name:"zh/guide/build-on-windows.md"},t=e(`<h1 id="在-windows-上构建" tabindex="-1">在 Windows 上构建 <a class="header-anchor" href="#在-windows-上构建" aria-label="Permalink to &quot;在 Windows 上构建&quot;"></a></h1><p>因为 Windows 系统是 NT 内核,与类 Unix 的操作系统使用的编译工具及操作系统接口几乎完全不同,所以在 Windows 上的构建流程会与 Unix 系统有些许不同。</p><h2 id="github-actions-构建" tabindex="-1">GitHub Actions 构建 <a class="header-anchor" href="#github-actions-构建" aria-label="Permalink to &quot;GitHub Actions 构建&quot;"></a></h2><p>现在已支持从 Actions 构建 Windows 版本的 static-php 了。 和 Linux、macOS 一样,你需要先 Fork static-php-cli 仓库到你的 GitHub 账户中,然后你可以进入 <a href="./extensions.html">扩展列表</a> 选择要编译的扩展,然后进入自己仓库的 <code>CI on Windows</code> 选择 PHP 版本、填入扩展列表(逗号分割),点击 Run 即可。</p><p>如果你要在本地开发或构建,请继续向下阅读。</p><h2 id="环境准备" tabindex="-1">环境准备 <a class="header-anchor" href="#环境准备" aria-label="Permalink to &quot;环境准备&quot;"></a></h2><p>在 Windows 上构建静态 PHP 所需要的工具与 PHP 官方的 Windows 构建工具是相同的。你可以阅读 <a href="https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2" target="_blank" rel="noreferrer">官方文档</a>。</p><p>总结下来,你需要以下环境及工具:</p><ul><li>Windows 10需要 build 17063 或以后的更新)</li><li>Visual Studio 2019/2022推荐 2022</li><li>Visual Studio 的 C++ 桌面开发</li><li>Git for Windows</li><li>static-php-cli 仓库</li><li>PHP 和 Composerstatic-php-cli 需要它们,可使用 <code>bin/setup-runtime</code> 自动安装)</li><li><a href="https://github.com/php/php-sdk-binary-tools" target="_blank" rel="noreferrer">php-sdk-binary-tools</a>(可使用 doctor 自动安装)</li><li>strawberry-perl可使用 doctor 自动安装)</li><li>nasm可使用 doctor 自动安装)</li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>static-php-cli 在 Windows 上的构建指的是使用 MSVC 构建 PHP不基于 MinGW、Cygwin、WSL 等环境。</p><p>如果你更倾向使用 WSL请参考在 Linux 上构建的章节。</p></div><p>在安装 Visual Studio 后,选择 C++ 桌面开发的工作负荷后,可能会下载 8GB 左右的编译工具,下载速度取决于你的网络状况。</p><h3 id="安装-git" tabindex="-1">安装 Git <a class="header-anchor" href="#安装-git" aria-label="Permalink to &quot;安装 Git&quot;"></a></h3><p>Git for Windows 可以从 <a href="https://git-scm.com/download/win" target="_blank" rel="noreferrer">这里</a> 下载并安装 <code>Standalone Installer 64-bit</code> 版本,安装在默认位置(<code>C:\\Program Files\\Git\\</code>)。 如果不想手动下载和安装,你也可以使用 Visual Studio Installer在<strong>单个组件</strong>的选择列表中,勾选 Git。</p><h3 id="准备-static-php-cli" tabindex="-1">准备 static-php-cli <a class="header-anchor" href="#准备-static-php-cli" aria-label="Permalink to &quot;准备 static-php-cli&quot;"></a></h3><p>static-php-cli 项目的下载方式很简单,只需要使用 git clone 即可。推荐将项目放在 <code>C:\\spc-build\\</code> 或类似目录,路径最好不要有空格。</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;">mkdir</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> &quot;C:\\spc-build&quot;</span></span>
<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>
<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/crazywhalecc/static-php-cli.git</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">cd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> static-php-cli</span></span></code></pre></div><p>static-php-cli PHP PHP Windows PHP static-php-cli 使 <code>bin/setup-runtime</code> PHP Composer</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:#6A737D;--shiki-dark:#6A737D;"># PHP Composer ./runtime/ </span></span>

View File

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

View File

@ -0,0 +1 @@
import{C as e}from"./chunks/CliGenerator.D06x6nXS.js";import{d as a,c as t,I as o,a1 as r,o as i}from"./chunks/framework.gjrnbxUT.js";const s=r('<h1 id="cli-编译命令生成器" tabindex="-1">CLI 编译命令生成器 <a class="header-anchor" href="#cli-编译命令生成器" aria-label="Permalink to &quot;CLI 编译命令生成器&quot;"></a></h1><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>下面选择扩展可能包含所选操作系统不支持的扩展,这可能导致编译失败。请先查阅 <a href="./extensions.html">支持的扩展</a>。</p></div>',2),p=JSON.parse('{"title":"CLI 编译命令生成器","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"zh/guide/cli-generator.md","filePath":"zh/guide/cli-generator.md"}'),c={name:"zh/guide/cli-generator.md"},_=a({...c,setup(l){return(n,d)=>(i(),t("div",null,[s,o(e,{lang:"zh"})]))}});export{p as __pageData,_ as default};

View File

@ -0,0 +1 @@
import{C as e}from"./chunks/CliGenerator.D06x6nXS.js";import{d as a,c as t,I as o,a1 as r,o as i}from"./chunks/framework.gjrnbxUT.js";const s=r('<h1 id="cli-编译命令生成器" tabindex="-1">CLI 编译命令生成器 <a class="header-anchor" href="#cli-编译命令生成器" aria-label="Permalink to &quot;CLI 编译命令生成器&quot;"></a></h1><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>下面选择扩展可能包含所选操作系统不支持的扩展,这可能导致编译失败。请先查阅 <a href="./extensions.html">支持的扩展</a>。</p></div>',2),p=JSON.parse('{"title":"CLI 编译命令生成器","description":"","frontmatter":{"aside":false},"headers":[],"relativePath":"zh/guide/cli-generator.md","filePath":"zh/guide/cli-generator.md"}'),c={name:"zh/guide/cli-generator.md"},_=a({...c,setup(l){return(n,d)=>(i(),t("div",null,[s,o(e,{lang:"zh"})]))}});export{p as __pageData,_ as default};

View File

@ -1 +0,0 @@
import{C as e}from"./chunks/CliGenerator.CID4JyzZ.js";import{d as t,c as a,I as o,a1 as r,o as i}from"./chunks/framework.CszIUXhs.js";const c=r('<h1 id="cli-编译命令生成器" tabindex="-1">CLI 编译命令生成器 <a class="header-anchor" href="#cli-编译命令生成器" aria-label="Permalink to &quot;CLI 编译命令生成器&quot;"></a></h1><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>下面选择扩展可能包含所选操作系统不支持的扩展,这可能导致编译失败。请先查阅 <a href="./extensions.html">支持的扩展</a>。</p></div>',2),p=JSON.parse('{"title":"CLI 编译命令生成器","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/cli-generator.md","filePath":"zh/guide/cli-generator.md"}'),s={name:"zh/guide/cli-generator.md"},_=t({...s,setup(l){return(n,d)=>(i(),a("div",null,[c,o(e,{lang:"zh"})]))}});export{p as __pageData,_ as default};

View File

@ -1 +0,0 @@
import{C as e}from"./chunks/CliGenerator.CID4JyzZ.js";import{d as t,c as a,I as o,a1 as r,o as i}from"./chunks/framework.CszIUXhs.js";const c=r('<h1 id="cli-编译命令生成器" tabindex="-1">CLI 编译命令生成器 <a class="header-anchor" href="#cli-编译命令生成器" aria-label="Permalink to &quot;CLI 编译命令生成器&quot;"></a></h1><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>下面选择扩展可能包含所选操作系统不支持的扩展,这可能导致编译失败。请先查阅 <a href="./extensions.html">支持的扩展</a>。</p></div>',2),p=JSON.parse('{"title":"CLI 编译命令生成器","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/cli-generator.md","filePath":"zh/guide/cli-generator.md"}'),s={name:"zh/guide/cli-generator.md"},_=t({...s,setup(l){return(n,d)=>(i(),a("div",null,[c,o(e,{lang:"zh"})]))}});export{p as __pageData,_ as default};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{_ as t,c as d,o as b,a1 as r}from"./chunks/framework.CszIUXhs.js";const z=JSON.parse('{"title":"依赖关系图表","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"zh/guide/deps-map.md","filePath":"zh/guide/deps-map.md"}'),l={name:"zh/guide/deps-map.md"},i=r("",22),e=[i];function s(o,a,n,p,m,h){return b(),d("div",null,e)}const g=t(l,[["render",s]]);export{z as __pageData,g as default};
import{_ as t,c as d,o as b,a1 as r}from"./chunks/framework.gjrnbxUT.js";const z=JSON.parse('{"title":"依赖关系图表","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"zh/guide/deps-map.md","filePath":"zh/guide/deps-map.md"}'),l={name:"zh/guide/deps-map.md"},i=r("",22),e=[i];function s(o,a,n,p,m,h){return b(),d("div",null,e)}const g=t(l,[["render",s]]);export{z as __pageData,g as default};

View File

@ -1,4 +1,4 @@
import{_ as t,c as i,o as e,a1 as s}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"环境变量","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/env-vars.md","filePath":"zh/guide/env-vars.md"}'),a={name:"zh/guide/env-vars.md"},d=s(`<h1 id="环境变量" tabindex="-1">环境变量 <a class="header-anchor" href="#环境变量" aria-label="Permalink to &quot;环境变量&quot;"></a></h1><p>本页面的环境变量列表中所提到的所有环境变量都具有默认值,除非另有说明。你可以通过设置这些环境变量来覆盖默认值。</p><h2 id="环境变量列表" tabindex="-1">环境变量列表 <a class="header-anchor" href="#环境变量列表" aria-label="Permalink to &quot;环境变量列表&quot;"></a></h2><p>在 2.3.5 版本之后,我们将环境变量集中到了 <code>config/env.ini</code> 文件中,你可以通过修改这个文件来设置环境变量。</p><p>我们将 static-php-cli 支持的环境变量分为三种:</p><ul><li>全局内部环境变量:在 static-php-cli 启动后即声明,你可以在 static-php-cli 的内部使用 <code>getenv()</code> 来获取他们,也可以在启动 static-php-cli 前覆盖。</li><li>固定环境变量:在 static-php-cli 启动后声明,你仅可使用 <code>getenv()</code> 获取,但无法通过 shell 脚本对其覆盖。</li><li>配置文件环境变量:在 static-php-cli 构建前声明,你可以通过修改 <code>config/env.ini</code> 文件或通过 shell 脚本来设置这些环境变量。</li></ul><p>你可以阅读 <a href="https://github.com/crazywhalecc/static-php-cli/blob/main/config/env.ini" target="_blank" rel="noreferrer">config/env.ini</a> 中每项参数的注释来了解其作用(仅限英文版)。</p><h2 id="自定义环境变量" tabindex="-1">自定义环境变量 <a class="header-anchor" href="#自定义环境变量" aria-label="Permalink to &quot;自定义环境变量&quot;"></a></h2><p>一般情况下,你不需要修改任何以下环境变量,因为它们已经被设置为最佳值。 但是,如果你有特殊需求,你可以通过设置这些环境变量来满足你的需求(比如你需要调试不同编译参数下的 PHP 性能表现)。</p><p>如需使用自定义环境变量,你可以在终端中使用 <code>export</code> 命令或者在命令前直接设置环境变量,例如:</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:#6A737D;--shiki-dark:#6A737D;"># export 方式</span></span>
import{_ as t,c as i,o as e,a1 as s}from"./chunks/framework.gjrnbxUT.js";const b=JSON.parse('{"title":"环境变量","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/env-vars.md","filePath":"zh/guide/env-vars.md"}'),a={name:"zh/guide/env-vars.md"},d=s(`<h1 id="环境变量" tabindex="-1">环境变量 <a class="header-anchor" href="#环境变量" aria-label="Permalink to &quot;环境变量&quot;"></a></h1><p>本页面的环境变量列表中所提到的所有环境变量都具有默认值,除非另有说明。你可以通过设置这些环境变量来覆盖默认值。</p><h2 id="环境变量列表" tabindex="-1">环境变量列表 <a class="header-anchor" href="#环境变量列表" aria-label="Permalink to &quot;环境变量列表&quot;"></a></h2><p>在 2.3.5 版本之后,我们将环境变量集中到了 <code>config/env.ini</code> 文件中,你可以通过修改这个文件来设置环境变量。</p><p>我们将 static-php-cli 支持的环境变量分为三种:</p><ul><li>全局内部环境变量:在 static-php-cli 启动后即声明,你可以在 static-php-cli 的内部使用 <code>getenv()</code> 来获取他们,也可以在启动 static-php-cli 前覆盖。</li><li>固定环境变量:在 static-php-cli 启动后声明,你仅可使用 <code>getenv()</code> 获取,但无法通过 shell 脚本对其覆盖。</li><li>配置文件环境变量:在 static-php-cli 构建前声明,你可以通过修改 <code>config/env.ini</code> 文件或通过 shell 脚本来设置这些环境变量。</li></ul><p>你可以阅读 <a href="https://github.com/crazywhalecc/static-php-cli/blob/main/config/env.ini" target="_blank" rel="noreferrer">config/env.ini</a> 中每项参数的注释来了解其作用(仅限英文版)。</p><h2 id="自定义环境变量" tabindex="-1">自定义环境变量 <a class="header-anchor" href="#自定义环境变量" aria-label="Permalink to &quot;自定义环境变量&quot;"></a></h2><p>一般情况下,你不需要修改任何以下环境变量,因为它们已经被设置为最佳值。 但是,如果你有特殊需求,你可以通过设置这些环境变量来满足你的需求(比如你需要调试不同编译参数下的 PHP 性能表现)。</p><p>如需使用自定义环境变量,你可以在终端中使用 <code>export</code> 命令或者在命令前直接设置环境变量,例如:</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:#6A737D;--shiki-dark:#6A737D;"># export 方式</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">export</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> SPC_CONCURRENCY</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">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;"> build</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> mbstring,pcntl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build-cli</span></span>
<span class="line"></span>

View File

@ -1 +1 @@
import{_ as t,c as i,o as e,a1 as s}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"环境变量","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/env-vars.md","filePath":"zh/guide/env-vars.md"}'),a={name:"zh/guide/env-vars.md"},d=s("",27),c=[d];function l(n,o,p,r,h,k){return e(),i("div",null,c)}const u=t(a,[["render",l]]);export{b as __pageData,u as default};
import{_ as t,c as i,o as e,a1 as s}from"./chunks/framework.gjrnbxUT.js";const b=JSON.parse('{"title":"环境变量","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/env-vars.md","filePath":"zh/guide/env-vars.md"}'),a={name:"zh/guide/env-vars.md"},d=s("",27),c=[d];function l(n,o,p,r,h,k){return e(),i("div",null,c)}const u=t(a,[["render",l]]);export{b as __pageData,u as default};

View File

@ -1 +1 @@
import{_ as e,c as o,o as l,a1 as a}from"./chunks/framework.CszIUXhs.js";const u=JSON.parse('{"title":"扩展注意事项","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/extension-notes.md","filePath":"zh/guide/extension-notes.md"}'),s={name:"zh/guide/extension-notes.md"},i=a("",56),r=[i];function t(h,c,d,p,n,b){return l(),o("div",null,r)}const g=e(s,[["render",t]]);export{u as __pageData,g as default};
import{_ as e,c as o,o as l,a1 as a}from"./chunks/framework.gjrnbxUT.js";const u=JSON.parse('{"title":"扩展注意事项","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/extension-notes.md","filePath":"zh/guide/extension-notes.md"}'),s={name:"zh/guide/extension-notes.md"},i=a("",56),r=[i];function t(h,c,d,p,n,b){return l(),o("div",null,r)}const g=e(s,[["render",t]]);export{u as __pageData,g as default};

View File

@ -0,0 +1 @@
import{_ as t}from"./chunks/SearchTable.CvLKjgM6.js";import{c as a,I as i,a1 as e,o as s}from"./chunks/framework.gjrnbxUT.js";const c=e('<h1 id="扩展列表" tabindex="-1">扩展列表 <a class="header-anchor" href="#扩展列表" aria-label="Permalink to &quot;扩展列表&quot;"></a></h1><blockquote><ul><li><code>yes</code>: 已支持</li><li>空白: 目前还不支持,或正在支持中</li><li><code>no</code> with issue link: 确定不支持或无法支持</li><li><code>partial</code> with issue link: 已支持,但是无法完美工作</li></ul></blockquote>',2),o=e('<div class="tip custom-block"><p class="custom-block-title">TIP</p><p>如果缺少您需要的扩展,您可以创建 <a href="https://github.com/crazywhalecc/static-php-cli/issues" target="_blank" rel="noreferrer">功能请求</a>。</p><p>有些扩展或扩展依赖的库会有一些可选的特性,例如 gd 库可选支持 libwebp、freetype 等。 如果你只使用 <code>bin/spc build gd --build-cli</code> 是不会包含它们static-php-cli 默认为最小依赖原则)。</p><p>有关编译可选库,请参考 <a href="./deps-map.html">扩展、库的依赖关系图表</a>。对于可选的库,你也可以从 <a href="./cli-generator.html">编译命令生成器</a> 中选择扩展后展开选择可选库。</p></div>',1),h=JSON.parse('{"title":"扩展列表","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/extensions.md","filePath":"zh/guide/extensions.md"}'),l={name:"zh/guide/extensions.md"},u=Object.assign(l,{setup(_){return(r,d)=>(s(),a("div",null,[c,i(t),o]))}});export{h as __pageData,u as default};

View File

@ -0,0 +1 @@
import{_ as t}from"./chunks/SearchTable.CvLKjgM6.js";import{c as a,I as i,a1 as e,o as s}from"./chunks/framework.gjrnbxUT.js";const c=e("",2),o=e("",1),h=JSON.parse('{"title":"扩展列表","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/extensions.md","filePath":"zh/guide/extensions.md"}'),l={name:"zh/guide/extensions.md"},u=Object.assign(l,{setup(_){return(r,d)=>(s(),a("div",null,[c,i(t),o]))}});export{h as __pageData,u as default};

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{_ as t,c as d,o as e,a1 as s}from"./chunks/framework.CszIUXhs.js";const f=JSON.parse('{"title":"扩展列表","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/extensions.md","filePath":"zh/guide/extensions.md"}'),r={name:"zh/guide/extensions.md"},y=s("",4),o=[y];function n(a,l,i,h,m,p){return e(),d("div",null,o)}const x=t(r,[["render",n]]);export{f as __pageData,x as default};

View File

@ -1 +1 @@
import{_ as t,c as a,o as e,a1 as d}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/index.md","filePath":"zh/guide/index.md"}'),i={name:"zh/guide/index.md"},r=d('<h1 id="指南" tabindex="-1">指南 <a class="header-anchor" href="#指南" aria-label="Permalink to &quot;指南&quot;"></a></h1><p>static-php-cli 是一个用于构建静态编译的 PHP 二进制的工具,目前支持 Linux 和 macOS 系统。</p><p>在指南章节中,你将了解到如何使用 static-php-cli 构建独立的 php 程序。</p><ul><li><a href="./action-build.html">Action 构建</a></li><li><a href="./manual-build.html">本地构建</a></li><li><a href="./extensions.html">扩展列表</a></li></ul><h2 id="编译环境" tabindex="-1">编译环境 <a class="header-anchor" href="#编译环境" aria-label="Permalink to &quot;编译环境&quot;"></a></h2><p>下面是架构支持情况,⚙️ 代表支持 GitHub Action 构建,💻 代表支持本地构建,空 代表暂不支持。</p><table tabindex="0"><thead><tr><th></th><th>x86_64</th><th>aarch64</th></tr></thead><tbody><tr><td>macOS</td><td>⚙️ 💻</td><td>⚙️ 💻</td></tr><tr><td>Linux</td><td>⚙️ 💻</td><td>⚙️ 💻</td></tr><tr><td>Windows</td><td>⚙️ 💻</td><td></td></tr><tr><td>FreeBSD</td><td>💻</td><td>💻</td></tr></tbody></table><p>其中Linux 目前仅在 Ubuntu、Debian、Alpine 发行版测试通过,其他发行版未进行测试,不能保证编译成功。 对于未经过测试的发行版,可以使用 Docker 等方式本地编译,避免环境导致的问题。</p><p>macOS 下支持 x86_64 和 Arm 两种架构,但在其中一个架构上编译的二进制无法直接在另一个架构上使用。 Rosetta 2 不能保证 Arm 架构编译的程序可以完全运行在 x86_64 环境下。</p><p>Windows 目前只支持 x86_64 架构,不支持 32 位 x86、不支持 arm64 架构。</p><h2 id="php-支持版本" tabindex="-1">PHP 支持版本 <a class="header-anchor" href="#php-支持版本" aria-label="Permalink to &quot;PHP 支持版本&quot;"></a></h2><p>目前static-php-cli 对 PHP 7.4 ~ 8.3 版本是支持的,对于 PHP 7.4 及更早版本理论上支持,只需下载时选择早期版本即可。 但由于部分扩展和特殊组件已对早期版本的 PHP 停止了支持,所以 static-php-cli 不会明确支持早期版本。 我们推荐你编译尽可能新的 PHP 版本,以获得更好的体验。</p>',12),h=[r];function n(o,l,c,p,s,_){return e(),a("div",null,h)}const P=t(i,[["render",n]]);export{m as __pageData,P as default};
import{_ as t,c as a,o as e,a1 as d}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/index.md","filePath":"zh/guide/index.md"}'),i={name:"zh/guide/index.md"},r=d('<h1 id="指南" tabindex="-1">指南 <a class="header-anchor" href="#指南" aria-label="Permalink to &quot;指南&quot;"></a></h1><p>static-php-cli 是一个用于构建静态编译的 PHP 二进制的工具,目前支持 Linux 和 macOS 系统。</p><p>在指南章节中,你将了解到如何使用 static-php-cli 构建独立的 php 程序。</p><ul><li><a href="./action-build.html">Action 构建</a></li><li><a href="./manual-build.html">本地构建</a></li><li><a href="./extensions.html">扩展列表</a></li></ul><h2 id="编译环境" tabindex="-1">编译环境 <a class="header-anchor" href="#编译环境" aria-label="Permalink to &quot;编译环境&quot;"></a></h2><p>下面是架构支持情况,⚙️ 代表支持 GitHub Action 构建,💻 代表支持本地构建,空 代表暂不支持。</p><table tabindex="0"><thead><tr><th></th><th>x86_64</th><th>aarch64</th></tr></thead><tbody><tr><td>macOS</td><td>⚙️ 💻</td><td>⚙️ 💻</td></tr><tr><td>Linux</td><td>⚙️ 💻</td><td>⚙️ 💻</td></tr><tr><td>Windows</td><td>⚙️ 💻</td><td></td></tr><tr><td>FreeBSD</td><td>💻</td><td>💻</td></tr></tbody></table><p>其中Linux 目前仅在 Ubuntu、Debian、Alpine 发行版测试通过,其他发行版未进行测试,不能保证编译成功。 对于未经过测试的发行版,可以使用 Docker 等方式本地编译,避免环境导致的问题。</p><p>macOS 下支持 x86_64 和 Arm 两种架构,但在其中一个架构上编译的二进制无法直接在另一个架构上使用。 Rosetta 2 不能保证 Arm 架构编译的程序可以完全运行在 x86_64 环境下。</p><p>Windows 目前只支持 x86_64 架构,不支持 32 位 x86、不支持 arm64 架构。</p><h2 id="php-支持版本" tabindex="-1">PHP 支持版本 <a class="header-anchor" href="#php-支持版本" aria-label="Permalink to &quot;PHP 支持版本&quot;"></a></h2><p>目前static-php-cli 对 PHP 7.4 ~ 8.3 版本是支持的,对于 PHP 7.4 及更早版本理论上支持,只需下载时选择早期版本即可。 但由于部分扩展和特殊组件已对早期版本的 PHP 停止了支持,所以 static-php-cli 不会明确支持早期版本。 我们推荐你编译尽可能新的 PHP 版本,以获得更好的体验。</p>',12),h=[r];function n(o,l,c,p,s,_){return e(),a("div",null,h)}const P=t(i,[["render",n]]);export{m as __pageData,P as default};

View File

@ -1 +1 @@
import{_ as t,c as a,o as e,a1 as d}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/index.md","filePath":"zh/guide/index.md"}'),i={name:"zh/guide/index.md"},r=d("",12),h=[r];function n(o,l,c,p,s,_){return e(),a("div",null,h)}const P=t(i,[["render",n]]);export{m as __pageData,P as default};
import{_ as t,c as a,o as e,a1 as d}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/index.md","filePath":"zh/guide/index.md"}'),i={name:"zh/guide/index.md"},r=d("",12),h=[r];function n(o,l,c,p,s,_){return e(),a("div",null,h)}const P=t(i,[["render",n]]);export{m as __pageData,P as default};

View File

@ -1,4 +1,4 @@
import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"本地构建Linux、macOS、FreeBSD","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/manual-build.md","filePath":"zh/guide/manual-build.md"}'),p={name:"zh/guide/manual-build.md"},l=n(`<h1 id="本地构建-linux、macos、freebsd" tabindex="-1">本地构建Linux、macOS、FreeBSD <a class="header-anchor" href="#本地构建-linux、macos、freebsd" aria-label="Permalink to &quot;本地构建Linux、macOS、FreeBSD&quot;"></a></h1><p>本章节为 Linux、macOS、FreeBSD 的构建过程,如果你要在 Windows 上构建,请到 <a href="./build-on-windows.html">在 Windows 上构建</a>。</p><h2 id="手动构建-使用-spc-二进制-推荐" tabindex="-1">手动构建(使用 SPC 二进制)(推荐) <a class="header-anchor" href="#手动构建-使用-spc-二进制-推荐" aria-label="Permalink to &quot;手动构建(使用 SPC 二进制)(推荐)&quot;"></a></h2><p>本项目提供了一个 static-php-cli 的二进制文件,你可以直接下载对应平台的二进制文件,然后使用它来构建静态的 PHP。目前 <code>spc</code> 二进制支持的平台有 Linux 和 macOS。</p><p>使用以下命令从自托管服务器下载:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</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;"># Download from self-hosted nightly builds (sync with main branch)</span></span>
import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"本地构建Linux、macOS、FreeBSD","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/manual-build.md","filePath":"zh/guide/manual-build.md"}'),p={name:"zh/guide/manual-build.md"},l=n(`<h1 id="本地构建-linux、macos、freebsd" tabindex="-1">本地构建Linux、macOS、FreeBSD <a class="header-anchor" href="#本地构建-linux、macos、freebsd" aria-label="Permalink to &quot;本地构建Linux、macOS、FreeBSD&quot;"></a></h1><p>本章节为 Linux、macOS、FreeBSD 的构建过程,如果你要在 Windows 上构建,请到 <a href="./build-on-windows.html">在 Windows 上构建</a>。</p><h2 id="手动构建-使用-spc-二进制-推荐" tabindex="-1">手动构建(使用 SPC 二进制)(推荐) <a class="header-anchor" href="#手动构建-使用-spc-二进制-推荐" aria-label="Permalink to &quot;手动构建(使用 SPC 二进制)(推荐)&quot;"></a></h2><p>本项目提供了一个 static-php-cli 的二进制文件,你可以直接下载对应平台的二进制文件,然后使用它来构建静态的 PHP。目前 <code>spc</code> 二进制支持的平台有 Linux 和 macOS。</p><p>使用以下命令从自托管服务器下载:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</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;"># Download from self-hosted nightly builds (sync with main branch)</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># For Linux x86_64</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -fsSL</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> spc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># For Linux aarch64</span></span>

View File

@ -1 +1 @@
import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.CszIUXhs.js";const g=JSON.parse('{"title":"本地构建Linux、macOS、FreeBSD","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/manual-build.md","filePath":"zh/guide/manual-build.md"}'),p={name:"zh/guide/manual-build.md"},l=n("",106),e=[l];function t(h,d,c,k,o,r){return a(),i("div",null,e)}const b=s(p,[["render",t]]);export{g as __pageData,b as default};
import{_ as s,c as i,o as a,a1 as n}from"./chunks/framework.gjrnbxUT.js";const g=JSON.parse('{"title":"本地构建Linux、macOS、FreeBSD","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/manual-build.md","filePath":"zh/guide/manual-build.md"}'),p={name:"zh/guide/manual-build.md"},l=n("",106),e=[l];function t(h,d,c,k,o,r){return a(),i("div",null,e)}const b=s(p,[["render",t]]);export{g as __pageData,b as default};

View File

@ -1 +1 @@
import{_ as e,c as o,o as a,a1 as t}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"故障排除","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/troubleshooting.md","filePath":"zh/guide/troubleshooting.md"}'),r={name:"zh/guide/troubleshooting.md"},s=t('<h1 id="故障排除" tabindex="-1">故障排除 <a class="header-anchor" href="#故障排除" aria-label="Permalink to &quot;故障排除&quot;"></a></h1><p>使用 static-php-cli 过程中可能会碰到各种各样的故障,这里将讲述如何自行查看错误并反馈 Issue。</p><h2 id="下载失败问题" tabindex="-1">下载失败问题 <a class="header-anchor" href="#下载失败问题" aria-label="Permalink to &quot;下载失败问题&quot;"></a></h2><p>下载资源问题是 spc 最常见的问题之一。主要是由于 spc 下载资源使用的地址一般均为对应项目的官方网站或 GitHub 等,而这些网站可能偶尔会宕机、屏蔽 IP 地址。 目前 2.0.0 版本还没有加入自动重试机制,所以在遇到下载失败后,可以多次尝试调用下载命令。如果确认地址确实无法正常访问,可以提交 Issue 或 PR 更新地址。</p><h2 id="doctor-无法修复" tabindex="-1">doctor 无法修复 <a class="header-anchor" href="#doctor-无法修复" aria-label="Permalink to &quot;doctor 无法修复&quot;"></a></h2><p>在绝大部分情况下doctor 模块都可以对缺失的系统环境进行自动修复和安装,但也存在特殊的环境无法正常使用自动修复功能。</p><p>部分项目由于系统局限(如 Windows 下无法自动安装 Visual Studio 等软件),无法使用自动修复功能。 在遇到无法自动修复功能时,如果遇到 <code>Some check items can not be fixed</code> 字样,则表明无法自动修复,请根据终端显示的方法提交 Issue 或自行修复环境。</p><h2 id="编译错误" tabindex="-1">编译错误 <a class="header-anchor" href="#编译错误" aria-label="Permalink to &quot;编译错误&quot;"></a></h2><p>遇到编译错误时,如果没有开启 <code>--debug</code> 日志,请先开启调试日志,然后确定报错的命令。 报错的终端输出对于修复编译错误非常重要,请在提交 Issue 时一并将终端日志的最后报错片段(或整个终端日志输出)上传,并且包含使用的 <code>spc</code> 命令和参数。</p>',9),c=[s];function i(d,n,h,l,u,_){return a(),o("div",null,c)}const m=e(r,[["render",i]]);export{b as __pageData,m as default};
import{_ as e,c as o,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.js";const b=JSON.parse('{"title":"故障排除","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/troubleshooting.md","filePath":"zh/guide/troubleshooting.md"}'),r={name:"zh/guide/troubleshooting.md"},s=t('<h1 id="故障排除" tabindex="-1">故障排除 <a class="header-anchor" href="#故障排除" aria-label="Permalink to &quot;故障排除&quot;"></a></h1><p>使用 static-php-cli 过程中可能会碰到各种各样的故障,这里将讲述如何自行查看错误并反馈 Issue。</p><h2 id="下载失败问题" tabindex="-1">下载失败问题 <a class="header-anchor" href="#下载失败问题" aria-label="Permalink to &quot;下载失败问题&quot;"></a></h2><p>下载资源问题是 spc 最常见的问题之一。主要是由于 spc 下载资源使用的地址一般均为对应项目的官方网站或 GitHub 等,而这些网站可能偶尔会宕机、屏蔽 IP 地址。 目前 2.0.0 版本还没有加入自动重试机制,所以在遇到下载失败后,可以多次尝试调用下载命令。如果确认地址确实无法正常访问,可以提交 Issue 或 PR 更新地址。</p><h2 id="doctor-无法修复" tabindex="-1">doctor 无法修复 <a class="header-anchor" href="#doctor-无法修复" aria-label="Permalink to &quot;doctor 无法修复&quot;"></a></h2><p>在绝大部分情况下doctor 模块都可以对缺失的系统环境进行自动修复和安装,但也存在特殊的环境无法正常使用自动修复功能。</p><p>部分项目由于系统局限(如 Windows 下无法自动安装 Visual Studio 等软件),无法使用自动修复功能。 在遇到无法自动修复功能时,如果遇到 <code>Some check items can not be fixed</code> 字样,则表明无法自动修复,请根据终端显示的方法提交 Issue 或自行修复环境。</p><h2 id="编译错误" tabindex="-1">编译错误 <a class="header-anchor" href="#编译错误" aria-label="Permalink to &quot;编译错误&quot;"></a></h2><p>遇到编译错误时,如果没有开启 <code>--debug</code> 日志,请先开启调试日志,然后确定报错的命令。 报错的终端输出对于修复编译错误非常重要,请在提交 Issue 时一并将终端日志的最后报错片段(或整个终端日志输出)上传,并且包含使用的 <code>spc</code> 命令和参数。</p>',9),c=[s];function i(d,n,h,l,u,_){return a(),o("div",null,c)}const m=e(r,[["render",i]]);export{b as __pageData,m as default};

View File

@ -1 +1 @@
import{_ as e,c as o,o as a,a1 as t}from"./chunks/framework.CszIUXhs.js";const b=JSON.parse('{"title":"故障排除","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/troubleshooting.md","filePath":"zh/guide/troubleshooting.md"}'),r={name:"zh/guide/troubleshooting.md"},s=t("",9),c=[s];function i(d,n,h,l,u,_){return a(),o("div",null,c)}const m=e(r,[["render",i]]);export{b as __pageData,m as default};
import{_ as e,c as o,o as a,a1 as t}from"./chunks/framework.gjrnbxUT.js";const b=JSON.parse('{"title":"故障排除","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/troubleshooting.md","filePath":"zh/guide/troubleshooting.md"}'),r={name:"zh/guide/troubleshooting.md"},s=t("",9),c=[s];function i(d,n,h,l,u,_){return a(),o("div",null,c)}const m=e(r,[["render",i]]);export{b as __pageData,m as default};

View File

@ -1 +1 @@
import{_ as e,c as t,o as i}from"./chunks/framework.CszIUXhs.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"在 Linux、macOS、FreeBSD、Windows 上与 PHP 项目一起构建独立的 PHP 二进制文件,并包含流行的扩展。","actions":[{"theme":"brand","text":"指南","link":"./guide/"}]},"features":[{"title":"静态二进制","details":"您可以轻松地编译一个独立的 PHP 二进制文件以供嵌入程序使用。包括 cli、fpm、micro。"},{"title":"phpmicro 自执行二进制","details":"您可以使用 micro SAPI 编译一个自解压的可执行文件,并将 PHP 代码与二进制文件打包为一个文件。"},{"title":"依赖管理","details":"static-php-cli 附带依赖项管理,支持安装不同类型的 PHP 扩展和不同的依赖库。"}]},"headers":[],"relativePath":"zh/index.md","filePath":"zh/index.md"}'),a={name:"zh/index.md"};function n(c,o,r,s,d,l){return i(),t("div")}const h=e(a,[["render",n]]);export{m as __pageData,h as default};
import{_ as e,c as t,o as i}from"./chunks/framework.gjrnbxUT.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"static-php-cli","tagline":"在 Linux、macOS、FreeBSD、Windows 上与 PHP 项目一起构建独立的 PHP 二进制文件,并包含流行的扩展。","actions":[{"theme":"brand","text":"指南","link":"./guide/"}]},"features":[{"title":"静态二进制","details":"您可以轻松地编译一个独立的 PHP 二进制文件以供嵌入程序使用。包括 cli、fpm、micro。"},{"title":"phpmicro 自执行二进制","details":"您可以使用 micro SAPI 编译一个自解压的可执行文件,并将 PHP 代码与二进制文件打包为一个文件。"},{"title":"依赖管理","details":"static-php-cli 附带依赖项管理,支持安装不同类型的 PHP 扩展和不同的依赖库。"}]},"headers":[],"relativePath":"zh/index.md","filePath":"zh/index.md"}'),a={name:"zh/index.md"};function n(c,o,r,s,d,l){return i(),t("div")}const h=e(a,[["render",n]]);export{m as __pageData,h as default};

Some files were not shown because too many files have changed in this diff Show More