From cd92d7ec409651befc8e9231f9246e09e2f5e4e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 23 Dec 2024 15:01:57 +0100 Subject: [PATCH] Make build command for program using embed portable --- sapi/embed/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/embed/README.md b/sapi/embed/README.md index c90ff354ab7d..87b144b4b120 100644 --- a/sapi/embed/README.md +++ b/sapi/embed/README.md @@ -36,12 +36,12 @@ To compile this, we must point the compiler to the PHP header files. The paths t We must also point the linker and the runtime loader to the `libphp.so` shared lib for linking PHP (`-lphp`) which is located at `$(php-config --prefix)/lib`. So the complete command to compile ends up being: ```bash -$ gcc \ +$ cc \ $(php-config --includes) \ -L$(php-config --prefix)/lib \ embed_sapi_basic_example.c \ -lphp \ - -Wl,-rpath=$(php-config --prefix)/lib + -Wl,-rpath,$(php-config --prefix)/lib ``` > :memo: The embed SAPI is disabled by default. In order for the above example to compile, PHP must be built with the embed SAPI enabled. To see what SAPIs are installed, run `php-config --php-sapis`. If you don't see `embed` in the list, you'll need to rebuild PHP with `./configure --enable-embed`. The PHP shared library `libphp.so` is built when the embed SAPI is enabled.