static-php-cli/en/guide/extension-notes.html

25 lines
35 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Extension Notes | Static PHP</title>
<meta name="description" content="Build single static PHP binary, with PHP project together, with popular extensions included.">
<meta name="generator" content="VitePress v2.0.0-alpha.12">
<link rel="preload stylesheet" href="/assets/style.Djf3bAdT.css" as="style">
<link rel="preload stylesheet" href="/vp-icons.css" as="style">
<script type="module" src="/assets/app.C9FYtCRt.js"></script>
<link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/assets/chunks/theme.MOrVMOSc.js">
<link rel="modulepreload" href="/assets/chunks/framework.Bhsyh9kO.js">
<link rel="modulepreload" href="/assets/en_guide_extension-notes.md.CHFGRiKx.lean.js">
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
<script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
</head>
<body>
<div id="app"><div class="Layout" data-v-1df9f90f><!--[--><!--]--><!--[--><span tabindex="-1" data-v-0b0ada53></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-0b0ada53>Skip to content</a><!--]--><!----><header class="VPNav" data-v-1df9f90f data-v-9f75dce3><div class="VPNavBar" data-v-9f75dce3 data-v-2a96a3d0><div class="wrapper" data-v-2a96a3d0><div class="container" data-v-2a96a3d0><div class="title" data-v-2a96a3d0><div class="VPNavBarTitle has-sidebar" data-v-2a96a3d0 data-v-1e38c6bc><a class="title" href="/en/" data-v-1e38c6bc><!--[--><!--]--><!--[--><img class="VPImage logo" src="/images/static-php_nobg.png" alt data-v-8426fc1a><!--]--><span data-v-1e38c6bc>Static PHP</span><!--[--><!--]--></a></div></div><div class="content" data-v-2a96a3d0><div class="content-body" data-v-2a96a3d0><!--[--><!--]--><div class="VPNavBarSearch search" data-v-2a96a3d0><!--[--><!----><div id="docsearch"><button type="button" aria-label="Search" aria-keyshortcuts="/ control+k meta+k" class="DocSearch DocSearch-Button"><span class="DocSearch-Button-Container"><span class="vpi-search DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key"></kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-2a96a3d0 data-v-39714824><span id="main-nav-aria-label" class="visually-hidden" data-v-39714824> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/en/guide/" tabindex="0" data-v-39714824 data-v-e56f3d57><!--[--><span data-v-e56f3d57>Guide</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/en/develop/" tabindex="0" data-v-39714824 data-v-e56f3d57><!--[--><span data-v-e56f3d57>Advanced</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/en/contributing/" tabindex="0" data-v-39714824 data-v-e56f3d57><!--[--><span data-v-e56f3d57>Contributing</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/en/faq/" tabindex="0" data-v-39714824 data-v-e56f3d57><!--[--><span data-v-e56f3d57>FAQ</span><!--]--></a><!--]--><!--]--></nav><div class="VPFlyout VPNavBarTranslations translations" data-v-2a96a3d0 data-v-88af2de4 data-v-42cb505d><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="Change language" data-v-42cb505d><span class="text" data-v-42cb505d><span class="vpi-languages option-icon" data-v-42cb505d></span><!----><span class="vpi-chevron-down text-icon" data-v-42cb505d></span></span></button><div class="menu" data-v-42cb505d><div class="VPMenu" data-v-42cb505d data-v-25a6cce8><!----><!--[--><!--[--><div class="items" data-v-88af2de4><p class="title" data-v-88af2de4>English</p><!--[--><div class="VPMenuLink" data-v-88af2de4 data-v-cd834e02><a class="VPLink link" href="/zh/guide/extension-notes.html" data-v-cd834e02><!--[--><span data-v-cd834e02>简体中文</span><!--]--></a></div><!--]--></div><!--]--><!--]--></div></div></div><div class="VPNavBarAppearance appearance" data-v-2a96a3d0 data-v-6c893767><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-6c893767 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-2a96a3d0 data-v-0394ad82 data-v-d07f11e6><!--[--><a class="VPSocialLink no-icon" href="https://github.com/crazywhalecc/static-php-cli" aria-label="github" target="_blank" rel="me noopener" data-v-d07f11e6 data-v-591a6b30><span class="vpi-social-github"></span></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-2a96a3d0 data-v-bb2aa2f0 data-v-42cb505d><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-42cb505d><span class="vpi-more-horizontal icon" data-v-42cb505d></span></button><div class="menu" data-v-42cb505d><div class="VPMenu" data-v-42cb505d data-v-25a6cce8><!----><!--[--><!--[--><div class="group translations" data-v-bb2aa2f0><p class="trans-title" data-v-bb2aa2f0>English</p><!--[--><div class="VPMenuLink" data-v-bb2aa2f0 data-v-cd834e02><a class="VPLink link" href="/zh/guide/extension-notes.html" data-v-cd834e02><!--[--><span data-v-cd834e02>简体中文</span><!--]--></a></div><!--]--></div><div class="group" data-v-bb2aa2f0><div class="item appearance" data-v-bb2aa2f0><p class="label" data-v-bb2aa2f0>Appearance</p><div class="appearance-action" data-v-bb2aa2f0><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-bb2aa2f0 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div></div></div><div class="group" data-v-bb2aa2f0><div class="item social-links" data-v-bb2aa2f0><div class="VPSocialLinks social-links-list" data-v-bb2aa2f0 data-v-d07f11e6><!--[--><a class="VPSocialLink no-icon" href="https://github.com/crazywhalecc/static-php-cli" aria-label="github" target="_blank" rel="me noopener" data-v-d07f11e6 data-v-591a6b30><span class="vpi-social-github"></span></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-2a96a3d0 data-v-e5dd9c1c><span class="container" data-v-e5dd9c1c><span class="top" data-v-e5dd9c1c></span><span class="middle" data-v-e5dd9c1c></span><span class="bottom" data-v-e5dd9c1c></span></span></button></div></div></div></div><div class="divider" data-v-2a96a3d0><div class="divider-line" data-v-2a96a3d0></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-1df9f90f data-v-8acdfeb5><div class="container" data-v-8acdfeb5><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-8acdfeb5><span class="vpi-align-left menu-icon" data-v-8acdfeb5></span><span class="menu-text" data-v-8acdfeb5>Menu</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-8acdfeb5 data-v-0bf0e06f><button data-v-0bf0e06f>Return to top</button><!----></div></div></div><aside class="VPSidebar" data-v-1df9f90f data-v-e7c6e512><div class="curtain" data-v-e7c6e512></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-e7c6e512><span class="visually-hidden" id="sidebar-aria-label" data-v-e7c6e512> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-8d50c081><section class="VPSidebarItem level-0 has-active" data-v-8d50c081 data-v-d81de50c><div class="item" role="button" tabindex="0" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><h2 class="text" data-v-d81de50c>Basic Build Guides</h2><!----></div><div class="items" data-v-d81de50c><!--[--><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Guide</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/manual-build.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Build (Local)</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/action-build.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Build (CI)</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/extensions.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Supported Extensions</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/extension-notes.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Extension Notes</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/cli-generator.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Build Command Generator</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 collapsible collapsed is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/env-vars.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Environment Variables</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/deps-map.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Dependency Table</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-8d50c081><section class="VPSidebarItem level-0" data-v-8d50c081 data-v-d81de50c><div class="item" role="button" tabindex="0" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><h2 class="text" data-v-d81de50c>Extended Build Guides</h2><!----></div><div class="items" data-v-d81de50c><!--[--><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/troubleshooting.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Troubleshooting</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/build-on-windows.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Build on Windows</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-d81de50c data-v-d81de50c><div class="item" data-v-d81de50c><div class="indicator" data-v-d81de50c></div><a class="VPLink link link" href="/en/guide/build-with-glibc.html" data-v-d81de50c><!--[--><p class="text" data-v-d81de50c>Build with GNU libc</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-1df9f90f data-v-aff0b8d7><div class="VPDoc has-sidebar has-aside" data-v-aff0b8d7 data-v-7011f0d8><!--[--><!--]--><div class="container" data-v-7011f0d8><div class="aside" data-v-7011f0d8><div class="aside-curtain" data-v-7011f0d8></div><div class="aside-container" data-v-7011f0d8><div class="aside-content" data-v-7011f0d8><div class="VPDocAside" data-v-7011f0d8 data-v-3f215769><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-3f215769 data-v-60d5052e><div class="content" data-v-60d5052e><div class="outline-marker" data-v-60d5052e></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-60d5052e>On this page</div><ul class="VPDocOutlineItem root" data-v-60d5052e data-v-2d0bdf9b><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-3f215769></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-7011f0d8><div class="content-container" data-v-7011f0d8><!--[--><!--]--><main class="main" data-v-7011f0d8><div style="position:relative;" class="vp-doc _en_guide_extension-notes" data-v-7011f0d8><div><h1 id="extension-notes" tabindex="-1">Extension Notes <a class="header-anchor" href="#extension-notes" aria-label="Permalink to “Extension Notes”"></a></h1><p>Because it is a static compilation, extensions will not compile 100% perfectly, and different extensions have different requirements for PHP and the environment, which will be listed one by one here.</p><h2 id="curl" tabindex="-1">curl <a class="header-anchor" href="#curl" aria-label="Permalink to “curl”"></a></h2><p>HTTP3 support is not enabled by default, compile with <code>--with-libs=&quot;nghttp2,nghttp3,ngtcp2&quot;</code> to enable HTTP3 support for PHP &gt;= 8.4.</p><p>When using curl to request HTTPS, there may be an <code>error:80000002:system library::No such file or directory</code> error. For details on the solution, see <a href="./../faq/#unable-to-use-ssl">FAQ - Unable to use ssl</a>.</p><h2 id="phpmicro" tabindex="-1">phpmicro <a class="header-anchor" href="#phpmicro" aria-label="Permalink to “phpmicro”"></a></h2><ol><li>Only PHP &gt;= 8.0 is supported.</li></ol><h2 id="swoole" tabindex="-1">swoole <a class="header-anchor" href="#swoole" aria-label="Permalink to “swoole”"></a></h2><ol><li>swoole &gt;= 5.0 Only PHP &gt;= 8.0 is supported.</li><li>swoole Currently, curl hooks are not supported for PHP 8.0.x (which may be fixed in the future).</li><li>When compiling, if only <code>swoole</code> extension is included, the supported Swoole database coroutine hook will not be fully enabled. If you need to use it, please add the corresponding <code>swoole-hook-xxx</code> extension.</li><li>The <code>zend_mm_heap corrupted</code> problem may occur in swoole under some extension combinations. The cause has not yet been found.</li></ol><h2 id="swoole-hook-pgsql" tabindex="-1">swoole-hook-pgsql <a class="header-anchor" href="#swoole-hook-pgsql" aria-label="Permalink to “swoole-hook-pgsql”"></a></h2><p>swoole-hook-pgsql is not an extension, it&#39;s a Hook feature of Swoole. If you use <code>swoole,swoole-hook-pgsql</code>, you will enable Swoole&#39;s PostgreSQL client and the coroutine mode of the <code>pdo_pgsql</code> extension.</p><p>swoole-hook-pgsql conflicts with the <code>pdo_pgsql</code> extension. If you want to use Swoole and <code>pdo_pgsql</code>, please delete the pdo_pgsql extension and enable <code>swoole</code> and <code>swoole-hook-pgsql</code>. This extension contains an implementation of the coroutine environment for <code>pdo_pgsql</code>.</p><p>On macOS systems, <code>pdo_pgsql</code> may not be able to connect to the postgresql server normally, please use it with caution.</p><h2 id="swoole-hook-mysql" tabindex="-1">swoole-hook-mysql <a class="header-anchor" href="#swoole-hook-mysql" aria-label="Permalink to “swoole-hook-mysql”"></a></h2><p>swoole-hook-mysql is not an extension, it&#39;s a Hook feature of Swoole. If you use <code>swoole,swoole-hook-mysql</code>, you will enable the coroutine mode of Swoole&#39;s <code>mysqlnd</code> and <code>pdo_mysql</code>.</p><h2 id="swoole-hook-sqlite" tabindex="-1">swoole-hook-sqlite <a class="header-anchor" href="#swoole-hook-sqlite" aria-label="Permalink to “swoole-hook-sqlite”"></a></h2><p>swoole-hook-sqlite is not an extension, it&#39;s a Hook feature of Swoole. If you use <code>swoole,swoole-hook-sqlite</code>, you will enable the coroutine mode of Swoole&#39;s <code>pdo_sqlite</code> (Swoole must be 5.1 or above).</p><p>swoole-hook-sqlite conflicts with the <code>pdo_sqlite</code> extension. If you want to use Swoole and <code>pdo_sqlite</code>, please delete the pdo_sqlite extension and enable <code>swoole</code> and <code>swoole-hook-sqlite</code>. This extension contains an implementation of the coroutine environment for <code>pdo_sqlite</code>.</p><h2 id="swoole-hook-odbc" tabindex="-1">swoole-hook-odbc <a class="header-anchor" href="#swoole-hook-odbc" aria-label="Permalink to “swoole-hook-odbc”"></a></h2><p>swoole-hook-odbc is not an extension, it&#39;s a Hook feature of Swoole. If you use <code>swoole,swoole-hook-odbc</code>, you will enable the coroutine mode of Swoole&#39;s <code>odbc</code> extension.</p><p>swoole-hook-odbc conflicts with the <code>pdo_odbc</code> extension. If you want to use Swoole and <code>pdo_odbc</code>, please delete the <code>pdo_odbc</code> extension and enable <code>swoole</code> and <code>swoole-hook-odbc</code>. This extension contains an implementation of the coroutine environment for <code>pdo_odbc</code>.</p><h2 id="swow" tabindex="-1">swow <a class="header-anchor" href="#swow" aria-label="Permalink to “swow”"></a></h2><ol><li>Only PHP 8.0+ is supported.</li></ol><h2 id="imagick" tabindex="-1">imagick <a class="header-anchor" href="#imagick" aria-label="Permalink to “imagick”"></a></h2><ol><li>OpenMP support is disabled, this is recommended by the maintainers and also the case system packages.</li></ol><h2 id="imap" tabindex="-1">imap <a class="header-anchor" href="#imap" aria-label="Permalink to “imap”"></a></h2><ol><li>Kerberos is not supported</li><li>ext-imap is not thread safe due to the underlying c-client. It&#39;s not possible to use it in <code>--enable-zts</code> builds.</li><li>The extension was dropped from php 8.4, we recommend you look for an alternative implementation, such as <a href="https://github.com/Webklex/php-imap" target="_blank" rel="noreferrer">Webklex/php-imap</a></li></ol><h2 id="gd" tabindex="-1">gd <a class="header-anchor" href="#gd" aria-label="Permalink to “gd”"></a></h2><ol><li>gd Extension relies on more additional Graphics library. By default, using <code>bin/spc build gd</code> directly will not support some Graphics library, such as <code>libjpeg</code>, <code>libavif</code>, etc. Currently, it supports four libraries: <code>freetype,libjpeg,libavif,libwebp</code>. Therefore, the following command can be used to introduce them into the gd library:</li></ol><div class="language-bash"><button title="Copy Code" class="copy"></button><span class="lang">bash</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 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;"> gd</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --with-libs=freetype,libjpeg,libavif,libwebp</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --build-cli</span></span></code></pre></div><h2 id="mcrypt" tabindex="-1">mcrypt <a class="header-anchor" href="#mcrypt" aria-label="Permalink to “mcrypt”"></a></h2><ol><li>Currently not supported, and this extension will not be supported in the future. <a href="https://github.com/crazywhalecc/static-php-cli/issues/32" target="_blank" rel="noreferrer">#32</a></li></ol><h2 id="oci8" tabindex="-1">oci8 <a class="header-anchor" href="#oci8" aria-label="Permalink to “oci8”"></a></h2><ol><li>oci8 is an extension of the Oracle database, because the library on which the extension provided by Oracle does not provide a statically compiled version (<code>.a</code>) or source code, and this extension cannot be compiled into php by static linking, so it cannot be supported.</li></ol><h2 id="xdebug" tabindex="-1">xdebug <a class="header-anchor" href="#xdebug" aria-label="Permalink to “xdebug”"></a></h2><ol><li>Xdebug is only buildable as a shared extension. On Linux, you&#39;ll need to use a SPC_TARGET like <code>native-native -dynamic</code> or <code>native-native-gnu</code>.</li><li>When using Linux/glibc or macOS, you can compile Xdebug as a shared extension using --build-shared=&quot;xdebug&quot;. The compiled <code>./php</code> binary can be configured and run by specifying the INI, eg <code>./php -d &#39;zend_extension=/path/to/xdebug.so&#39; your-code.php</code>.</li></ol><h2 id="xml" tabindex="-1">xml <a class="header-anchor" href="#xml" aria-label="Permalink to “xml”"></a></h2><ol><li>xml includes xml, xmlreader, xmlwriter, xsl, dom, simplexml, etc. When adding xml extensions, it is best to enable these extensions at the same time.</li><li>libxml is included in xml extension. Enabling xml is equivalent to enabling libxml.</li></ol><h2 id="glfw" tabindex="-1">glfw <a class="header-anchor" href="#glfw" aria-label="Permalink to “glfw”"></a></h2><ol><li>glfw depends on OpenGL, and linux environment also needs X11, which cannot be linked statically.</li><li>macOS platform, we can compile and link system builtin OpenGL and related libraries dynamically.</li></ol><h2 id="rar" tabindex="-1">rar <a class="header-anchor" href="#rar" aria-label="Permalink to “rar”"></a></h2><ol><li>The rar extension currently has a problem when compiling phpmicro with the <code>common</code> extension collection in the macOS x86_64 environment.</li></ol><h2 id="pgsql" tabindex="-1">pgsql <a class="header-anchor" href="#pgsql" aria-label="Permalink to “pgsql”"></a></h2><p><s>pgsql ssl connection is not compatible with openssl 3.2.0. See:</s></p><ul><li><s><a href="https://github.com/Homebrew/homebrew-core/issues/155651" target="_blank" rel="noreferrer">https://github.com/Homebrew/homebrew-core/issues/155651</a></s></li><li><s><a href="https://github.com/Homebrew/homebrew-core/pull/155699" target="_blank" rel="noreferrer">https://github.com/Homebrew/homebrew-core/pull/155699</a></s></li><li><s><a href="https://github.com/postgres/postgres/commit/c82207a548db47623a2bfa2447babdaa630302b9" target="_blank" rel="noreferrer">https://github.com/postgres/postgres/commit/c82207a548db47623a2bfa2447babdaa630302b9</a></s></li></ul><p>pgsql 16.2 has fixed this bug, now it&#39;s working.</p><p>When pgsql uses SSL connection, there may be <code>error:80000002:system library::No such file or directory</code> error, For details on the solution, see <a href="./../faq/#unable-to-use-ssl">FAQ - Unable to use ssl</a>.</p><h2 id="openssl" tabindex="-1">openssl <a class="header-anchor" href="#openssl" aria-label="Permalink to “openssl”"></a></h2><p>When using openssl-based extensions (such as curl, pgsql and other network libraries), there may be an <code>error:80000002:system library::No such file or directory</code> error. For details on the solution, see <a href="./../faq/#unable-to-use-ssl">FAQ - Unable to use ssl</a>.</p><h2 id="password-argon2" tabindex="-1">password-argon2 <a class="header-anchor" href="#password-argon2" aria-label="Permalink to “password-argon2”"></a></h2><ol><li>password-argon2 is not a standard extension. The algorithm <code>PASSWORD_ARGON2ID</code> for the <code>password_hash</code> function needs libsodium or libargon2 to work.</li><li>using password-argon2 enables multithread support for this.</li></ol><h2 id="ffi" tabindex="-1">ffi <a class="header-anchor" href="#ffi" aria-label="Permalink to “ffi”"></a></h2><ol><li>Due to the limitation of musl libc&#39;s static linkage, you cannot use ffi because dynamic libraries cannot be loaded. If you need to use the ffi extension, see <a href="./build-with-glibc.html">Compile PHP with GNU libc</a>.</li><li>macOS supports the ffi extension, but errors will occur when some kernels do not contain debugging symbols.</li><li>Windows x64 supports the ffi extension.</li></ol><h2 id="xhprof" tabindex="-1">xhprof <a class="header-anchor" href="#xhprof" aria-label="Permalink to “xhprof”"></a></h2><p>The xhprof extension consists of three parts: <code>xhprof_extension</code>, <code>xhprof_html</code>, <code>xhprof_libs</code>. Only <code>xhprof_extension</code> is included in the compiled binary. If you need to use xhprof, please download the source code from <a href="http://pecl.php.net/package/xhprof" target="_blank" rel="noreferrer">pecl.php.net/package/xhprof</a> and specify the <code>xhprof_libs</code> and <code>xhprof_html</code> paths for use.</p><h2 id="event" tabindex="-1">event <a class="header-anchor" href="#event" aria-label="Permalink to “event”"></a></h2><p>If you enable event extension on macOS, the <code>openpty</code> will be disabled due to issue:</p><ul><li><a href="https://github.com/crazywhalecc/static-php-cli/issues/335" target="_blank" rel="noreferrer">static-php-cli#335</a></li></ul><h2 id="parallel" tabindex="-1">parallel <a class="header-anchor" href="#parallel" aria-label="Permalink to “parallel”"></a></h2><p>Parallel is only supported on PHP 8.0 ZTS and above.</p><h2 id="spx" tabindex="-1">spx <a class="header-anchor" href="#spx" aria-label="Permalink to “spx”"></a></h2><ol><li>SPX does not support Windows, and the official repository does not support static compilation. static-php-cli uses a <a href="https://github.com/static-php/php-spx" target="_blank" rel="noreferrer">modified version</a>.</li></ol><h2 id="mimalloc" tabindex="-1">mimalloc <a class="header-anchor" href="#mimalloc" aria-label="Permalink to “mimalloc”"></a></h2><ol><li>This is not technically an extension, but a library.</li><li>Building with <code>--with-libs=&quot;mimalloc&quot;</code> on Linux or macOS will override the default allocator.</li><li>This is experimental for now, but is recommended in threaded environments.</li></ol></div></div></main><footer class="VPDocFooter" data-v-7011f0d8 data-v-e257564d><!--[--><!--]--><!----><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/en/guide/extensions.html" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>Previous page</span><span class="title" data-v-e257564d>Supported Extensions</span><!--]--></a></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/en/guide/cli-generator.html" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>Next page</span><span class="title" data-v-e257564d>Build Command Generator</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-1df9f90f data-v-c3855bb3><div class="container" data-v-c3855bb3><p class="message" data-v-c3855bb3>Released under the MIT License.</p><p class="copyright" data-v-c3855bb3>Copyright © 2023-present crazywhalecc</p></div></footer><!--[--><!--]--></div></div>
<script>window.__VP_HASH_MAP__=JSON.parse("{\"deps-craft-yml.md\":\"DqNYV3B0\",\"deps-map-ext.md\":\"CbR9NHhU\",\"deps-map-lib.md\":\"8HihnPWz\",\"en_contributing_index.md\":\"fCA6lXnW\",\"en_develop_craft-yml.md\":\"Ci97ssL7\",\"en_develop_doctor-module.md\":\"BTDyp-aK\",\"en_develop_index.md\":\"DUNrUVP9\",\"en_develop_php-src-changes.md\":\"dN8aSiwg\",\"en_develop_source-module.md\":\"CTCLlqsP\",\"en_develop_structure.md\":\"X2JId3N9\",\"en_develop_system-build-tools.md\":\"BmQhyTle\",\"en_faq_index.md\":\"C_VQHF6y\",\"en_guide_action-build.md\":\"Dnzq6gNC\",\"en_guide_build-on-windows.md\":\"DiYVSaPG\",\"en_guide_build-with-glibc.md\":\"CkVR75n5\",\"en_guide_cli-generator.md\":\"UTa1fYPO\",\"en_guide_deps-map.md\":\"DE2pYG8h\",\"en_guide_env-vars.md\":\"51DQ7bvx\",\"en_guide_extension-notes.md\":\"CHFGRiKx\",\"en_guide_extensions.md\":\"CsvaBCHe\",\"en_guide_index.md\":\"C0gwKWb1\",\"en_guide_manual-build.md\":\"DPsGII1D\",\"en_guide_troubleshooting.md\":\"D19jRB1K\",\"en_index.md\":\"Yhlq3Fhs\",\"extension-notes.md\":\"BB7Xlw1w\",\"extensions.md\":\"21FahcJc\",\"index.md\":\"CZze5I_S\",\"zh_contributing_index.md\":\"fiiKMXnj\",\"zh_develop_craft-yml.md\":\"CAUu6v38\",\"zh_develop_doctor-module.md\":\"1NRXIINs\",\"zh_develop_index.md\":\"CRxnJZDt\",\"zh_develop_php-src-changes.md\":\"CwVUc0oE\",\"zh_develop_source-module.md\":\"CS1VBo_1\",\"zh_develop_structure.md\":\"CEd1RycZ\",\"zh_develop_system-build-tools.md\":\"CQ4BvPVa\",\"zh_faq_index.md\":\"DyNJg3PZ\",\"zh_guide_action-build.md\":\"CQ3Vf3i9\",\"zh_guide_build-on-windows.md\":\"oogWrPn_\",\"zh_guide_build-with-glibc.md\":\"CHXyK61r\",\"zh_guide_cli-generator.md\":\"BCkvpmPR\",\"zh_guide_deps-map.md\":\"DAkLVlbR\",\"zh_guide_env-vars.md\":\"CtNlqGk4\",\"zh_guide_extension-notes.md\":\"BCwDjBZH\",\"zh_guide_extensions.md\":\"D77mpxgk\",\"zh_guide_index.md\":\"BBGjnhq-\",\"zh_guide_manual-build.md\":\"C3iksvHw\",\"zh_guide_troubleshooting.md\":\"BRQLW2WP\",\"zh_index.md\":\"DO7udOc6\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Static PHP\",\"description\":\"Build single static PHP binary, with PHP project together, with popular extensions included.\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"logo\":\"/images/static-php_nobg.png\",\"nav\":[],\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/crazywhalecc/static-php-cli\"}],\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2023-present crazywhalecc\"},\"search\":{\"provider\":\"algolia\",\"options\":{\"appId\":\"IHJHUB1SF1\",\"apiKey\":\"8266d31cc2ffbd0e059f1c6e5bdaf8fc\",\"indexName\":\"static-php docs\"}}},\"locales\":{\"en\":{\"label\":\"English\",\"lang\":\"en\",\"themeConfig\":{\"nav\":[{\"text\":\"Guide\",\"link\":\"/en/guide/\"},{\"text\":\"Advanced\",\"link\":\"/en/develop/\"},{\"text\":\"Contributing\",\"link\":\"/en/contributing/\"},{\"text\":\"FAQ\",\"link\":\"/en/faq/\"}],\"sidebar\":{\"/en/guide/\":[{\"text\":\"Basic Build Guides\",\"items\":[{\"text\":\"Guide\",\"link\":\"/en/guide/\"},{\"text\":\"Build (Local)\",\"link\":\"/en/guide/manual-build\"},{\"text\":\"Build (CI)\",\"link\":\"/en/guide/action-build\"},{\"text\":\"Supported Extensions\",\"link\":\"/en/guide/extensions\"},{\"text\":\"Extension Notes\",\"link\":\"/en/guide/extension-notes\"},{\"text\":\"Build Command Generator\",\"link\":\"/en/guide/cli-generator\"},{\"text\":\"Environment Variables\",\"link\":\"/en/guide/env-vars\",\"collapsed\":true},{\"text\":\"Dependency Table\",\"link\":\"/en/guide/deps-map\"}]},{\"text\":\"Extended Build Guides\",\"items\":[{\"text\":\"Troubleshooting\",\"link\":\"/en/guide/troubleshooting\"},{\"text\":\"Build on Windows\",\"link\":\"/en/guide/build-on-windows\"},{\"text\":\"Build with GNU libc\",\"link\":\"/en/guide/build-with-glibc\"}]}],\"/en/develop/\":[{\"text\":\"Development\",\"items\":[{\"text\":\"Get Started\",\"link\":\"/en/develop/\"},{\"text\":\"Project Structure\",\"link\":\"/en/develop/structure\"},{\"text\":\"PHP Source Modification\",\"link\":\"/en/develop/php-src-changes\"}]},{\"text\":\"Module\",\"items\":[{\"text\":\"Doctor \",\"link\":\"/en/develop/doctor-module\"},{\"text\":\"Source\",\"link\":\"/en/develop/source-module\"}]},{\"text\":\"Extra\",\"items\":[{\"text\":\"Compilation Tools\",\"link\":\"/en/develop/system-build-tools\"},{\"text\":\"craft.yml Configuration\",\"link\":\"/zh/develop/craft-yml\"}]}],\"/en/contributing/\":[{\"text\":\"Contributing\",\"items\":[{\"text\":\"Contributing\",\"link\":\"/en/contributing/\"}]}]},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2023-present crazywhalecc\"}}},\"zh\":{\"label\":\"简体中文\",\"lang\":\"zh\",\"themeConfig\":{\"nav\":[{\"text\":\"构建指南\",\"link\":\"/zh/guide/\"},{\"text\":\"进阶\",\"link\":\"/zh/develop/\"},{\"text\":\"贡献\",\"link\":\"/zh/contributing/\"},{\"text\":\"FAQ\",\"link\":\"/zh/faq/\"}],\"sidebar\":{\"/zh/guide/\":[{\"text\":\"构建指南\",\"items\":[{\"text\":\"指南\",\"link\":\"/zh/guide/\"},{\"text\":\"本地构建\",\"link\":\"/zh/guide/manual-build\"},{\"text\":\"Actions 构建\",\"link\":\"/zh/guide/action-build\"},{\"text\":\"扩展列表\",\"link\":\"/zh/guide/extensions\"},{\"text\":\"扩展注意事项\",\"link\":\"/zh/guide/extension-notes\"},{\"text\":\"编译命令生成器\",\"link\":\"/zh/guide/cli-generator\"},{\"text\":\"环境变量列表\",\"link\":\"/zh/guide/env-vars\"},{\"text\":\"依赖关系图表\",\"link\":\"/zh/guide/deps-map\"}]},{\"text\":\"扩展构建指南\",\"items\":[{\"text\":\"故障排除\",\"link\":\"/zh/guide/troubleshooting\"},{\"text\":\"在 Windows 上构建\",\"link\":\"/zh/guide/build-on-windows\"},{\"text\":\"构建 GNU libc 兼容的二进制\",\"link\":\"/zh/guide/build-with-glibc\"}]}],\"/zh/develop/\":[{\"text\":\"开发指南\",\"items\":[{\"text\":\"开发简介\",\"link\":\"/zh/develop/\"},{\"text\":\"项目结构简介\",\"link\":\"/zh/develop/structure\"},{\"text\":\"对 PHP 源码的修改\",\"link\":\"/zh/develop/php-src-changes\"}]},{\"text\":\"模块\",\"items\":[{\"text\":\"Doctor 环境检查工具\",\"link\":\"/zh/develop/doctor-module\"},{\"text\":\"资源模块\",\"link\":\"/zh/develop/source-module\"}]},{\"text\":\"其他\",\"items\":[{\"text\":\"系统编译工具\",\"link\":\"/zh/develop/system-build-tools\"},{\"text\":\"craft.yml 配置详解\",\"link\":\"/zh/develop/craft-yml\"}]}],\"/zh/contributing/\":[{\"text\":\"贡献指南\",\"items\":[{\"text\":\"贡献指南\",\"link\":\"/zh/contributing/\"}]}]},\"footer\":{\"message\":\"Released under the MIT License.\",\"copyright\":\"Copyright © 2023-present crazywhalecc\"}}}},\"scrollOffset\":134,\"cleanUrls\":false,\"additionalConfig\":{}}");</script>
</body>
</html>