import{_ase,casi,oast,a1aso}from"./chunks/framework.gjrnbxUT.js";constf=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('<h1id="modifications-to-php-source-code"tabindex="-1">ModificationstoPHPsourcecode<aclass="header-anchor"href="#modifications-to-php-source-code"aria-label="Permalink to "Modifications to PHP source code""></a></h1><p>Duringthestaticcompilationprocess,static-php-climadesomemodificationstothePHPsourcecodeinordertoachievegoodcompatibility,performance,andsecurity.ThefollowingisadescriptionofthecurrentmodificationstothePHPsourcecode.</p><h2id="micro-related-patches"tabindex="-1">Microrelatedpatches<aclass="header-anchor"href="#micro-related-patches"aria-label="Permalinkto"Microrelatedpatches""></a></h2><p>Basedonthepatchesprovidedbythephpmicroproject,static-php-clihasmadesomemodificationstothePHPsourcecodetomeettheneedsofstaticcompilation.Thepatchescurrentlyusedbystatic-php-cliduringcompilationinthe<ahref="https://github.com/easysoft/phpmicro/tree/master/patches"target="_blank"rel="noreferrer">patchlist</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><h2id="php-8-1-libxml-patch"tabindex="-1">PHP<=8.1libxmlpatch<aclass="header-anchor"href="#php-8-1-libxml-patch"aria-label="Permalinkto"PHP<=8.1libxmlpatch""></a></h2><p>BecausePHPonlyprovidessecurityupdatesfor8.1andstopsupdatingolderversions,static-php-cliappliesthelibxmlcompilationpatchthathasbeenappliedinnewerversionsofPHPtoPHP8.1andbelow.</p><h2id="gd-extension-windows-patch"tabindex="-1">gdextensionWindowspatch<aclass="header-anchor"href="#gd-extension-windows-patch"aria-label="Permalinkto"gdextensionWindowspatch""></a></h2><p>CompilingthegdextensionunderWindowsrequiresmajorchangestothe<code>config.w32</code>file.static-php-clihasmadesomechangestothegdextensiontomakeiteasiertocompileunderWindows.</p><h2id="yaml-extension-windows-patch"tabindex="-1">YAMLextensionWindowspatch<aclass="header-anchor"href="#yaml-extension-windows-patch"aria-label="Permalinkto"YAMLextensionWindowspatch""></a></h2><p>YAMLextensionneedstomodifythe<code>config.w32</code>filetocompileunderWindows.static-php-clihasmadesomemodificationstotheYAMLextensiontomakeiteasiertocompileunderWindows.</p><h2id="static-php-cli-version-information-insertion"tabindex="-1">static-php-cliversioninformationinsertion<aclass="header-anchor"href="#static-php-cli-version-information-insertion"aria-label="Permalinkto"static-php-cliversioninformationinsertion""></a></h2><p>Whencompiling,static-php-cliwillinsertthestatic-php-cliversioninformationintothePHPversioninformationforeasyidentification.</p><h2id="add-option-to-hardcode-ini"tabindex="-1">AddoptiontohardcodeINI<aclass="header-anchor"href="#add-option-to-hardcode-ini"aria-label="Permalinkto"AddoptiontohardcodeINI""></a></h2><p>Whenusingthe<code>-I</code>parametertohardcodeINIintostaticPHPfunctionality,static-php-cliwillmodifythePHPsourcecodetoinsertthehardcodedcontent.</p><h2id="linux-system-repair-patch"tabindex="-1">Linuxsystemrepairpatch<aclass="header-anchor"href="#linux-system-repair-patch"aria-label="Permalinkto"Linuxsystemrepairpatch""></a></h2><p>Somecompilationenvironmentsmaylacksomesystemheaderfilesorlibraries.static-php-cliwillautomaticallyfixtheseproblemsduringcompilation,suchas:</p><ul><li>HAVE_STRLCATmissingproblem</li><li>HA