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
I don't see PHP or PHP (Embed SAPI) in the list. PH7 seems to be listed but is basically a dead project.
It's a little known fact that a PHP SAPI ("Server" API) can be compiled specifically for embedding full PHP scripting engine support into other C/C++ software applications: --enable-embed[=static] at compile time generates the embed SAPI. From there, just include the appropriate header files and link against the library during compilation. For non-C/C++ languages, the language will probably need a C shim that adds a small translation layer. PHP is VERY macro-heavy, which means trying to correctly import shared library exports is not a really great idea.
Since embedding support is already included with the PHP language itself, I guess just link to www.php.net?
include/php contains header files, which are needed to build additional extensions or embed PHP in custom software.
The macro PHP_EMBED_START_BLOCK seems to be the magic Google/GitHub/StackOverflow search engine keyword that turns up sample working code snippets. For example, I got this:
@cubiclesoft Since this seems nuanced, and I am not familiar with embedding PHP, could you PR an entry for PHP with a good "notes" column? (Do not edit README.md directly. Add the information to data/projects.toml.)
I don't see
PHP
orPHP (Embed SAPI)
in the list. PH7 seems to be listed but is basically a dead project.It's a little known fact that a PHP SAPI ("Server" API) can be compiled specifically for embedding full PHP scripting engine support into other C/C++ software applications:
--enable-embed[=static]
at compile time generates theembed
SAPI. From there, just include the appropriate header files and link against the library during compilation. For non-C/C++ languages, the language will probably need a C shim that adds a small translation layer. PHP is VERY macro-heavy, which means trying to correctly import shared library exports is not a really great idea.Since embedding support is already included with the PHP language itself, I guess just link to www.php.net?
https://www.phpinternalsbook.com/php7/build_system/building_php.html
The macro
PHP_EMBED_START_BLOCK
seems to be the magic Google/GitHub/StackOverflow search engine keyword that turns up sample working code snippets. For example, I got this:https://stackoverflow.com/questions/73345686/store-output-of-php-execute-script
The text was updated successfully, but these errors were encountered: