mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-06 16:25:39 +08:00
deploy: ab948dedaf
This commit is contained in:
1
assets/en_develop_php-src-changes.md.Dw_q8s3t.js
Normal file
1
assets/en_develop_php-src-changes.md.Dw_q8s3t.js
Normal file
@@ -0,0 +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 "Modifications to PHP source code""></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 "Micro related patches""></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 <= 8.1 libxml patch <a class="header-anchor" href="#php-8-1-libxml-patch" aria-label="Permalink to "PHP <= 8.1 libxml patch""></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 "gd extension Windows patch""></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 "YAML extension Windows patch""></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 "static-php-cli version information insertion""></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 "Add option to hardcode INI""></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 "Linux system repair patch""></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 "Fiber issue fix patch for Windows""></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};
|
||||
1
assets/en_develop_php-src-changes.md.Dw_q8s3t.lean.js
Normal file
1
assets/en_develop_php-src-changes.md.Dw_q8s3t.lean.js
Normal file
@@ -0,0 +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};
|
||||
1
assets/zh_develop_php-src-changes.md.C7L9rEms.js
Normal file
1
assets/zh_develop_php-src-changes.md.C7L9rEms.js
Normal file
@@ -0,0 +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 "对 PHP 源码的修改""></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 "micro 相关补丁""></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 <= 8.1 libxml 补丁 <a class="header-anchor" href="#php-8-1-libxml-补丁" aria-label="Permalink to "PHP <= 8.1 libxml 补丁""></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 "gd 扩展 Windows 补丁""></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 "yaml 扩展 Windows 补丁""></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 "static-php-cli 版本信息插入""></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 "加入硬编码 INI 的选项""></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 "Linux 系统修复补丁""></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 "Windows 系统下 Fiber 问题修复补丁""></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};
|
||||
1
assets/zh_develop_php-src-changes.md.C7L9rEms.lean.js
Normal file
1
assets/zh_develop_php-src-changes.md.C7L9rEms.lean.js
Normal file
@@ -0,0 +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};
|
||||
Reference in New Issue
Block a user