You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For macOS platform, almost all binaries under macOS cannot be truly purely statically linked, and almost all binaries will link macOS system libraries: `/usr/lib/libresolv.9.dylib` and `/usr/lib/libSystem.B.dylib`.
41
-
So on macOS, you can use statically compiled PHP binaries under certain compilation conditions, and dynamically linked extensions:
41
+
So on macOS, you can **directly**use SPC to build statically compiled PHP binaries with dynamically linked extensions:
42
42
43
-
1. Using the `--no-strip` parameter will not strip information such as debugging symbols from the binary file for use with external Zend extensions such as `Xdebug`.
44
-
2. If you want to compile some Zend extensions, use Homebrew, MacPorts, source code compilation, and install a normal version of PHP on your operating system.
45
-
3. Use the `phpize && ./configure && make` command to compile the extensions you want to use.
46
-
4. Copy the extension file `xxxx.so` to the outside, use the statically compiled PHP binary, for example to use the Xdebug extension: `cd buildroot/bin/ && ./php -d "zend_extension=/path/to/xdebug.so"`.
47
-
48
-
```bash
49
-
# build statically linked php-cli but not stripped
Copy file name to clipboardExpand all lines: docs/en/guide/manual-build.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -339,7 +339,7 @@ You can try to use the following commands:
339
339
- `--cxx=XXX`: Specifies the execution command of the C++ language compiler (Linux defaults to `g++`, macOS defaults to `clang++`)
340
340
- `--with-clean`: clean up old make files before compiling PHP
341
341
- `--enable-zts`: Make compiled PHP thread-safe version (default is NTS version)
342
-
- `--no-strip`: Do not run `strip` after compiling the PHP library to trim the binary file to reduce its size (the macOS binary file without trim can use dynamically linked third-party extensions)
342
+
- `--no-strip`: Do not run `strip` after compiling the PHP library to trim the binary file to reduce its size
343
343
- `--with-libs=XXX,YYY`: Compile the specified dependent library before compiling PHP, and activate some extended optional functions (such as libavif of the gd library, etc.)
344
344
- `--with-config-file-path=XXX`: Set the path in which to look for `php.ini` (Check [here](../faq/index.html#what-is-the-path-of-php-ini) for default paths)
345
345
- `--with-config-file-scan-dir=XXX`: Set the directory to scan for `.ini` files after reading `php.ini` (Check [here](../faq/index.html#what-is-the-path-of-php-ini) for default paths)
$this->addOption('with-config-file-path', null, InputOption::VALUE_REQUIRED, 'Set the path in which to look for php.ini', $isWindows ? null : '/usr/local/etc/php');
40
40
$this->addOption('with-config-file-scan-dir', null, InputOption::VALUE_REQUIRED, 'Set the directory to scan for .ini files after reading php.ini', $isWindows ? null : '/usr/local/etc/php/conf.d');
@@ -62,11 +62,6 @@ public function handle(): int
62
62
$rule = $this->parseRules($shared_extensions);
63
63
64
64
// check dynamic extension build env
65
-
// macOS must use --no-strip option
66
-
if (!empty($shared_extensions) && PHP_OS_FAMILY === 'Darwin' && !$this->getOption('no-strip')) {
67
-
$this->output->writeln('MacOS does not support dynamic extension loading with stripped binary, please use --no-strip option!');
0 commit comments