<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">buildroot/bin/php</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"zend_extension=/path/to/php{PHP_VER}-{ts/nts}/xdebug.so"</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --ri</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> xdebug</span></span></code></pre></div><p>For macOS platform, almost all binaries under macOS cannot be truly purely statically linked, and almost all binaries will link macOS system libraries: <code>/usr/lib/libresolv.9.dylib</code> and <code>/usr/lib/libSystem.B.dylib</code>. So on macOS, you can <strong>directly</strong> use SPC to build statically compiled PHP binaries with dynamically linked extensions:</p><ol><li>Build shared extension <code>xxx.so</code> using: <code>--build-shared=XXX</code> option. e.g. <code>bin/spc build bcmath,zlib --build-shared=xdebug --build-cli</code></li><li>You will get <code>buildroot/modules/xdebug.so</code> and <code>buildroot/bin/php</code>.</li><li>The <code>xdebug.so</code> file could be used for php that version and thread-safe are the same.</li></ol><p>For the Windows platform, since officially built extensions (such as <code>php_yaml.dll</code>) force the use of the <code>php8.dll</code> dynamic library as a link, and statically built PHP does not include any dynamic libraries other than system libraries, php.exe built by static-php cannot load officially built dynamic extensions. Since static-php-cli does not yet support building dynamic extensions, there is currently no way to load dynamic extensions with static-php.</p><p>However, Windows can normally use the <code>FFI</code> extension to load other dll files and call them.</p><h2id="can-it-support-oracle-database-extension"tabindex="-1">Can it support Oracle database extension? <aclass="header-anchor"href="#can-it-support-oracle-database-extension"aria-label="Permalink to “Can it support Oracle database extension?”"></a></h2><p>Some extensions that rely on closed source libraries, such as <code>oci8</code>, <code>sourceguardian</code>, etc., they do not provide purely statically compiled dependent library files (<code>.a</code>), only dynamic dependent library files (<code>.so</code>). These extensions cannot be compiled into static-php-cli using source code, so this project may never support these extensions. However, in theory you can access and use such extensions under macOS and Linux according to the above questions.</p><p>If you have a need for such extensions, or most people have needs for these closed-source extensions, see the discussion on <ahref="https://github.com/crazywhalecc/static-php-cli/discussions/58"target="_blank"rel="noreferrer">standalone-php-cli</a>. Welcome to leave a message.</p><h2id="does-it-support-windows"tabindex="-1">Does it support Windows? <aclass="header-anchor"href="#does-it-support-windows"aria-label="Permalink to “Does it support Windows?”"></a></h2><p>The project currently supports Windows, but the number of supported extensions is small. Windows support is not perfect. There are mainly the following problems:</p><ol><li>The compilation process of Windows is different from that of *nix, and the toolchain used is also different. The compilation tools used to compile the dependent libraries of each extension are almost completely different.</li><li>The demand for the Windows version will also be advanced based on the needs of all people who use this project. If many people need it, I will support related extensions as soon as possible.</li></ol><h2id="can-i-protect-my-source-code-with-micro"tabindex="-1">Can I protect my source code with micro? <aclass="header-anchor"href="#can-i-protect-my-source-code-with-micro"aria-label="Permalink to “Can I protect my source code with micro?”"></a></h2><p>You can't. micro.sfx is essentially combining php and php code into one file, there is no process of compiling or encrypting the PHP