<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><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 code.</p><p>First of all, php-src is the official interpreter of PHP code, and there is no PHP compiler compatible with mainstream branches on the market. I saw on the Internet that there is a project called BPC (Binary PHP Compiler?) that can compile PHP into binary, but there are many restrictions.</p><p>The direction of encrypting and protecting the code is not the same as compiling. After compiling, the code can also be obtained through reverse engineering and other methods. The real protection is still carried out by means of packing and encrypting the code.</p><p>Therefore, this