mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 09:25:35 +08:00
deploy: fafe7d5778
This commit is contained in:
1
assets/zh_contributing_index.md.22akXfoC.js
Normal file
1
assets/zh_contributing_index.md.22akXfoC.js
Normal file
@@ -0,0 +1 @@
|
||||
import{_ as a,c as i,o as l,af as o}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"贡献指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/contributing/index.md","filePath":"zh/contributing/index.md"}'),r={name:"zh/contributing/index.md"};function n(t,e,c,d,s,h){return l(),i("div",null,e[0]||(e[0]=[o('<h1 id="贡献指南" tabindex="-1">贡献指南 <a class="header-anchor" href="#贡献指南" aria-label="Permalink to “贡献指南”"></a></h1><p>感谢你能够看到这里,本项目非常欢迎你的贡献!</p><h2 id="贡献方法" tabindex="-1">贡献方法 <a class="header-anchor" href="#贡献方法" aria-label="Permalink to “贡献方法”"></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 “贡献类型”"></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 “安全更新”"></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 “修复 Bug”"></a></h3><p>修复 Bug 一般不涉及项目结构和框架的修改,所以如果你能定位到错误代码并直接修复它,请直接提交 PR。</p><h3 id="新扩展" tabindex="-1">新扩展 <a class="header-anchor" href="#新扩展" aria-label="Permalink to “新扩展”"></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> SAPIs 中正常工作。</li><li>编写文档并添加你的扩展。</li></ol><h3 id="项目框架优化" tabindex="-1">项目框架优化 <a class="header-anchor" href="#项目框架优化" aria-label="Permalink to “项目框架优化”"></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)]))}const f=a(r,[["render",n]]);export{m as __pageData,f as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as a,c as i,o as l,af as o}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"贡献指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/contributing/index.md","filePath":"zh/contributing/index.md"}'),r={name:"zh/contributing/index.md"};function n(t,e,c,d,s,h){return l(),i("div",null,e[0]||(e[0]=[o('<h1 id="贡献指南" tabindex="-1">贡献指南 <a class="header-anchor" href="#贡献指南" aria-label="Permalink to “贡献指南”"></a></h1><p>感谢你能够看到这里,本项目非常欢迎你的贡献!</p><h2 id="贡献方法" tabindex="-1">贡献方法 <a class="header-anchor" href="#贡献方法" aria-label="Permalink to “贡献方法”"></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 “贡献类型”"></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 “安全问题”"></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 “修复 Bug”"></a></h3><p>修复 Bug 一般不涉及项目结构和框架的修改,所以如果你可以定位到错误代码并直接修复它,请直接提交 PR。</p><h3 id="新扩展" tabindex="-1">新扩展 <a class="header-anchor" href="#新扩展" aria-label="Permalink to “新扩展”"></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 “项目框架优化”"></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)]))}const f=a(r,[["render",n]]);export{m as __pageData,f as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as a,c as i,o as t,af as s}from"./chunks/framework.PeLcR_tw.js";const P=JSON.parse('{"title":"开发简介","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/index.md","filePath":"zh/develop/index.md"}'),p={name:"zh/develop/index.md"};function o(r,e,l,n,c,d){return t(),i("div",null,e[0]||(e[0]=[s('<h1 id="开发简介" tabindex="-1">开发简介 <a class="header-anchor" href="#开发简介" aria-label="Permalink to “开发简介”"></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 “环境准备”"></a></h2><p>开发本项目需要 PHP 环境。你可以使用系统自带的 PHP,也可以使用本项目构建的静态 PHP。</p><p>无论是使用哪种 PHP,在开发环境,你需要安装这些扩展:</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>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 “开始开发”"></a></h2><p>继续向下查看项目结构的文档,你可以从中了解 <code>static-php-cli</code> 是如何运作的。</p>',13)]))}const m=a(p,[["render",o]]);export{P as __pageData,m as default};
|
||||
1
assets/zh_develop_index.md.DecU9Y3b.js
Normal file
1
assets/zh_develop_index.md.DecU9Y3b.js
Normal file
@@ -0,0 +1 @@
|
||||
import{_ as a,c as i,o as t,af as s}from"./chunks/framework.PeLcR_tw.js";const P=JSON.parse('{"title":"开发简介","description":"","frontmatter":{},"headers":[],"relativePath":"zh/develop/index.md","filePath":"zh/develop/index.md"}'),p={name:"zh/develop/index.md"};function o(r,e,l,n,c,d){return t(),i("div",null,e[0]||(e[0]=[s('<h1 id="开发简介" tabindex="-1">开发简介 <a class="header-anchor" href="#开发简介" aria-label="Permalink to “开发简介”"></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 “环境准备”"></a></h2><p>开发本项目需要 PHP 环境。你可以使用系统自带的 PHP,也可以使用本项目构建的静态 PHP。</p><p>无论是使用哪种 PHP,在开发环境,你需要安装这些扩展:</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span>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 “开始开发”"></a></h2><p>继续向下查看项目结构文档,你可以学习 <code>static-php-cli</code> 是如何工作的。</p>',13)]))}const m=a(p,[["render",o]]);export{P as __pageData,m as default};
|
||||
File diff suppressed because one or more lines are too long
4
assets/zh_faq_index.md.nE1d0aPt.js
Normal file
4
assets/zh_faq_index.md.nE1d0aPt.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{_ as e,c as a,o as s,af as o}from"./chunks/framework.PeLcR_tw.js";const b=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq/index.md","filePath":"zh/faq/index.md"}'),c={name:"zh/faq/index.md"};function p(d,i,l,n,r,h){return s(),a("div",null,i[0]||(i[0]=[o("",34)]))}const k=e(c,[["render",p]]);export{b as __pageData,k as default};
|
||||
import{_ as i,c as a,o as s,af as o}from"./chunks/framework.PeLcR_tw.js";const b=JSON.parse('{"title":"常见问题","description":"","frontmatter":{},"headers":[],"relativePath":"zh/faq/index.md","filePath":"zh/faq/index.md"}'),c={name:"zh/faq/index.md"};function p(d,e,l,n,r,h){return s(),a("div",null,e[0]||(e[0]=[o("",35)]))}const k=i(c,[["render",p]]);export{b as __pageData,k as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as t,c as a,o,af as i}from"./chunks/framework.PeLcR_tw.js";const u=JSON.parse('{"title":"Action 构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/action-build.md","filePath":"zh/guide/action-build.md"}'),c={name:"zh/guide/action-build.md"};function r(l,e,n,d,h,p){return o(),a("div",null,e[0]||(e[0]=[i('<h1 id="action-构建" tabindex="-1">Action 构建 <a class="header-anchor" href="#action-构建" aria-label="Permalink to “Action 构建”"></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 “构建方法”"></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 “扩展选择”"></a></h2><p>你可以到 <a href="./extensions.html">扩展列表</a> 中查看目前你需要的扩展是否均支持, 然后到 <a href="./cli-generator.html">在线命令生成</a> 中选择你需要编译的扩展,复制扩展字符串到 Action 的 <code>extensions</code> 中,编译即可。</p>',11)]))}const f=t(c,[["render",r]]);export{u as __pageData,f as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as t,c as a,o,af as i}from"./chunks/framework.PeLcR_tw.js";const u=JSON.parse('{"title":"Action 构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/action-build.md","filePath":"zh/guide/action-build.md"}'),c={name:"zh/guide/action-build.md"};function r(l,e,n,d,h,p){return o(),a("div",null,e[0]||(e[0]=[i("",11)]))}const f=t(c,[["render",r]]);export{u as __pageData,f as default};
|
||||
1
assets/zh_guide_action-build.md.CYeVjGhJ.js
Normal file
1
assets/zh_guide_action-build.md.CYeVjGhJ.js
Normal file
@@ -0,0 +1 @@
|
||||
import{_ as t,c as a,o as i,af as o}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"Action 构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/action-build.md","filePath":"zh/guide/action-build.md"}'),r={name:"zh/guide/action-build.md"};function l(c,e,n,s,d,p){return i(),a("div",null,e[0]||(e[0]=[o('<h1 id="action-构建" tabindex="-1">Action 构建 <a class="header-anchor" href="#action-构建" aria-label="Permalink to “Action 构建”"></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>。 包含的扩展有: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="构建方法" tabindex="-1">构建方法 <a class="header-anchor" href="#构建方法" aria-label="Permalink to “构建方法”"></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 “扩展选择”"></a></h2><p>你可以到 <a href="./extensions.html">扩展列表</a> 中查看目前你需要的扩展是否均支持, 然后到 <a href="./cli-generator.html">在线命令生成</a> 中选择你需要编译的扩展,复制扩展字符串到 Action 的 <code>extensions</code> 中,编译即可。</p>',11)]))}const f=t(r,[["render",l]]);export{m as __pageData,f as default};
|
||||
1
assets/zh_guide_action-build.md.CYeVjGhJ.lean.js
Normal file
1
assets/zh_guide_action-build.md.CYeVjGhJ.lean.js
Normal file
@@ -0,0 +1 @@
|
||||
import{_ as t,c as a,o as i,af as o}from"./chunks/framework.PeLcR_tw.js";const m=JSON.parse('{"title":"Action 构建","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/action-build.md","filePath":"zh/guide/action-build.md"}'),r={name:"zh/guide/action-build.md"};function l(c,e,n,s,d,p){return i(),a("div",null,e[0]||(e[0]=[o("",11)]))}const f=t(r,[["render",l]]);export{m as __pageData,f as default};
|
||||
@@ -1 +1 @@
|
||||
import{_ as a,c as e,o as d,af as i}from"./chunks/framework.PeLcR_tw.js";const _=JSON.parse('{"title":"指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/index.md","filePath":"zh/guide/index.md"}'),r={name:"zh/guide/index.md"};function n(h,t,l,p,c,o){return d(),e("div",null,t[0]||(t[0]=[i('<h1 id="指南" tabindex="-1">指南 <a class="header-anchor" href="#指南" aria-label="Permalink to “指南”"></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 “编译环境”"></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 “PHP 支持版本”"></a></h2><p>目前,static-php-cli 对 PHP 8.1 ~ 8.4 版本是支持的,对于 PHP 8.0 及更早版本理论上支持,只需下载时选择早期版本即可。 但由于部分扩展和特殊组件已对早期版本的 PHP 停止了支持,所以 static-php-cli 不会明确支持早期版本。 我们推荐你编译尽可能新的 PHP 版本,以获得更好的体验。</p>',12)]))}const m=a(r,[["render",n]]);export{_ as __pageData,m as default};
|
||||
import{_ as a,c as e,o as d,af as i}from"./chunks/framework.PeLcR_tw.js";const _=JSON.parse('{"title":"指南","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/index.md","filePath":"zh/guide/index.md"}'),r={name:"zh/guide/index.md"};function n(h,t,l,p,c,o){return d(),e("div",null,t[0]||(t[0]=[i('<h1 id="指南" tabindex="-1">指南 <a class="header-anchor" href="#指南" aria-label="Permalink to “指南”"></a></h1><p>static-php-cli 是一个用于构建静态编译的 PHP 二进制的工具,目前支持 Linux 和 macOS 系统。</p><p>在指南章节中,你将了解到如何使用 static-php-cli 构建独立的 php 程序。</p><ul><li><a href="./manual-build.html">本地构建</a></li><li><a href="./action-build.html">Action 构建</a></li><li><a href="./extensions.html">扩展列表</a></li></ul><h2 id="编译环境" tabindex="-1">编译环境 <a class="header-anchor" href="#编译环境" aria-label="Permalink to “编译环境”"></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 “PHP 支持版本”"></a></h2><p>目前,static-php-cli 对 PHP 8.1 ~ 8.4 版本是支持的,对于 PHP 8.0 及更早版本理论上支持,只需下载时选择早期版本即可。 但由于部分扩展和特殊组件已对早期版本的 PHP 停止了支持,所以 static-php-cli 不会明确支持早期版本。 我们推荐你编译尽可能新的 PHP 版本,以获得更好的体验。</p>',12)]))}const m=a(r,[["render",n]]);export{_ as __pageData,m as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as o,c as t,o as a,af as r}from"./chunks/framework.PeLcR_tw.js";const u=JSON.parse('{"title":"故障排除","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/troubleshooting.md","filePath":"zh/guide/troubleshooting.md"}'),s={name:"zh/guide/troubleshooting.md"};function d(c,e,i,n,l,p){return a(),t("div",null,e[0]||(e[0]=[r('<h1 id="故障排除" tabindex="-1">故障排除 <a class="header-anchor" href="#故障排除" aria-label="Permalink to “故障排除”"></a></h1><p>使用 static-php-cli 过程中可能会碰到各种各样的故障,这里将讲述如何自行查看错误并反馈 Issue。</p><h2 id="下载失败问题" tabindex="-1">下载失败问题 <a class="header-anchor" href="#下载失败问题" aria-label="Permalink to “下载失败问题”"></a></h2><p>下载资源问题是 spc 最常见的问题之一。主要是由于 spc 下载资源使用的地址一般均为对应项目的官方网站或 GitHub 等,而这些网站可能偶尔会宕机、屏蔽 IP 地址。 在遇到下载失败后,可以多次尝试调用下载命令。</p><p>当下载资源时,你可能最终会看到类似 <code>curl: (56) The requested URL returned error: 403</code> 的错误,这通常是由于 GitHub 限制导致的。 你可以通过在命令中添加 <code>--debug</code> 来验证,会看到类似 <code>[DEBU] Running command (no output) : curl -sfSL "https://api.github.com/repos/openssl/openssl/releases"</code> 的输出。</p><p>要解决这个问题,可以在 GitHub 上 <a href="https://github.com/settings/token" target="_blank" rel="noreferrer">创建</a> 一个个人访问令牌,并将其设置为环境变量 <code>GITHUB_TOKEN=<XXX></code>。</p><p>如果确认地址确实无法正常访问,可以提交 Issue 或 PR 更新地址。</p><h2 id="doctor-无法修复" tabindex="-1">doctor 无法修复 <a class="header-anchor" href="#doctor-无法修复" aria-label="Permalink to “doctor 无法修复”"></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 “编译错误”"></a></h2><p>遇到编译错误时,如果没有开启 <code>--debug</code> 日志,请先开启调试日志,然后确定报错的命令。 报错的终端输出对于修复编译错误非常重要,请在提交 Issue 时一并将终端日志的最后报错片段(或整个终端日志输出)上传,并且包含使用的 <code>spc</code> 命令和参数。</p><p>如果你是重复构建,请参考 <a href="./manual-build.html#多次构建">本地构建 - 多次构建</a> 章节,清理构建缓存后再次构建。</p>',13)]))}const _=o(s,[["render",d]]);export{u as __pageData,_ as default};
|
||||
1
assets/zh_guide_troubleshooting.md.DSUIb51x.js
Normal file
1
assets/zh_guide_troubleshooting.md.DSUIb51x.js
Normal file
@@ -0,0 +1 @@
|
||||
import{_ as o,c as t,o as a,af as r}from"./chunks/framework.PeLcR_tw.js";const u=JSON.parse('{"title":"故障排除","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/troubleshooting.md","filePath":"zh/guide/troubleshooting.md"}'),s={name:"zh/guide/troubleshooting.md"};function c(d,e,i,n,l,p){return a(),t("div",null,e[0]||(e[0]=[r('<h1 id="故障排除" tabindex="-1">故障排除 <a class="header-anchor" href="#故障排除" aria-label="Permalink to “故障排除”"></a></h1><p>使用 static-php-cli 过程中可能会碰到各种各样的故障,这里将讲述如何自行查看错误并反馈 Issue。</p><h2 id="下载失败问题" tabindex="-1">下载失败问题 <a class="header-anchor" href="#下载失败问题" aria-label="Permalink to “下载失败问题”"></a></h2><p>下载资源问题是 spc 最常见的问题之一。主要是由于 spc 下载资源使用的地址一般均为对应项目的官方网站或 GitHub 等,而这些网站可能偶尔会宕机、屏蔽 IP 地址。 在遇到下载失败后,可以多次尝试调用下载命令。</p><p>当下载资源时,你可能最终会看到类似 <code>curl: (56) The requested URL returned error: 403</code> 的错误,这通常是由于 GitHub 限制导致的。 你可以通过在命令中添加 <code>--debug</code> 来验证,会看到类似 <code>[DEBU] Running command (no output) : curl -sfSL "https://api.github.com/repos/openssl/openssl/releases"</code> 的输出。</p><p>要解决这个问题,可以在 GitHub 上 <a href="https://github.com/settings/tokens" target="_blank" rel="noreferrer">创建</a> 一个个人访问令牌,并将其设置为环境变量 <code>GITHUB_TOKEN=<XXX></code>。</p><p>如果确认地址确实无法正常访问,可以提交 Issue 或 PR 更新地址或下载类型。</p><h2 id="doctor-无法修复某些问题" tabindex="-1">Doctor 无法修复某些问题 <a class="header-anchor" href="#doctor-无法修复某些问题" aria-label="Permalink to “Doctor 无法修复某些问题”"></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 “编译错误”"></a></h2><p>遇到编译错误时,如果没有开启 <code>--debug</code> 日志,请先开启调试日志,然后确定报错的命令。 报错的终端输出对于修复编译错误非常重要。 在提交 Issue 时,请上传终端日志的最后报错片段(或整个终端日志输出),并且包含使用的 <code>spc</code> 命令和参数。</p><p>如果你是重复构建,请参考 <a href="./manual-build.html#多次构建">本地构建 - 多次构建</a> 章节。</p>',13)]))}const _=o(s,[["render",c]]);export{u as __pageData,_ as default};
|
||||
@@ -1 +1 @@
|
||||
import{_ as o,c as t,o as a,af as r}from"./chunks/framework.PeLcR_tw.js";const u=JSON.parse('{"title":"故障排除","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/troubleshooting.md","filePath":"zh/guide/troubleshooting.md"}'),s={name:"zh/guide/troubleshooting.md"};function d(c,e,i,n,l,p){return a(),t("div",null,e[0]||(e[0]=[r("",13)]))}const _=o(s,[["render",d]]);export{u as __pageData,_ as default};
|
||||
import{_ as o,c as t,o as a,af as r}from"./chunks/framework.PeLcR_tw.js";const u=JSON.parse('{"title":"故障排除","description":"","frontmatter":{},"headers":[],"relativePath":"zh/guide/troubleshooting.md","filePath":"zh/guide/troubleshooting.md"}'),s={name:"zh/guide/troubleshooting.md"};function c(d,e,i,n,l,p){return a(),t("div",null,e[0]||(e[0]=[r("",13)]))}const _=o(s,[["render",c]]);export{u as __pageData,_ as default};
|
||||
Reference in New Issue
Block a user