mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
2 lines
2.6 KiB
JavaScript
2 lines
2.6 KiB
JavaScript
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};
|