From a5e4d6a5ec3ad3700481a234d200f8bed68ac129 Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Sun, 30 Mar 2025 23:36:23 +0700 Subject: [PATCH] xdebug and ffi compilable shared, updated notes --- config/ext.json | 10 ++++++---- docs/en/guide/extension-notes.md | 11 +++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/config/ext.json b/config/ext.json index 3d99350c..df4cd432 100644 --- a/config/ext.json +++ b/config/ext.json @@ -119,6 +119,10 @@ "Linux": "partial", "BSD": "wip" }, + "target": [ + "static", + "shared" + ], "notes": true, "arg-type": "custom", "type": "builtin", @@ -772,8 +776,7 @@ "BSD": "wip" }, "target": [ - "static", - "shared" + "static" ], "notes": true, "type": "external", @@ -1048,8 +1051,7 @@ "BSD": "wip" }, "target": [ - "static", - "shared" + "static" ], "type": "builtin", "arg-type": "with-prefix", diff --git a/docs/en/guide/extension-notes.md b/docs/en/guide/extension-notes.md index 1d9209c9..c012200d 100644 --- a/docs/en/guide/extension-notes.md +++ b/docs/en/guide/extension-notes.md @@ -76,10 +76,9 @@ and this extension cannot be compiled into php by static linking, so it cannot b ## xdebug -1. Xdebug is only buildable as a shared extension. On Linux, you need to use static-php-cli with SPC_LIBC=glibc and then compile php-xdebug from source with the option `--with-php-config=/path/to/buildroot/bin/php-config`. -2. The macOS platform can compile an xdebug extension under PHP compiled on the same platform, -extract the `xdebug.so` file, and then use the `--no-strip` parameter in static-php-cli to retain the debug symbol table and add the `ffi` extension. -The compiled `./php` binary can be configured and run by specifying the INI, eg `./php -d 'zend_extension=/path/to/xdebug.so' your-code.php`. +1. Xdebug is only buildable as a shared extension. On Linux, you need to use static-php-cli with SPC_LIBC=glibc. +2. When using Linux/glibc or macOS, you can compile Xdebug as a shared extension using --build-shared="xdebug". + The compiled `./php` binary can be configured and run by specifying the INI, eg `./php -d 'zend_extension=/path/to/xdebug.so' your-code.php`. ## xml @@ -122,8 +121,8 @@ For details on the solution, see [FAQ - Unable to use ssl](../faq/#unable-to-use ## ffi -1. Due to the limitation of Linux system, you cannot use it to load other `so` extensions in the purely static compiled state (spc defaults to pure static compilation). - Linux supports loading so extensions only if they are non-statically compiled. If you need to use the ffi extension, see [Compile PHP with GNU libc](./build-with-glibc). +1. Due to the limitation of musl libc's static linkage, you cannot use ffi because dynamic libraries cannot be loaded. + If you need to use the ffi extension, see [Compile PHP with GNU libc](./build-with-glibc). 2. macOS supports the ffi extension, but errors will occur when some kernels do not contain debugging symbols. 3. Windows x64 supports the ffi extension.