Skip to content

Dynamic linking non-zend extensions and how to statically link with a zend extension ? #369

Closed Answered by crazywhalecc
henrywood asked this question in Q&A
Discussion options

You must be logged in to vote

Couldn't you just load (non-zend) extensions using dl() at runtime ?

Actually it depends on your OS. Linux cannot load dynamic extension at runtime in static binary (linux kernel limitations). Windows and macOS do support loading dynamically with static binary (same to ffi).

But if you are going to run statically linked PHP binary on specific distro, like ubuntu, debian (based on glibc), it's possible to make a NOT-PURELY-STATIC linux executable while also supporting portability.

Could you show an example of how to compile static-php-cli statically with my company's zend_extension

For normal extension, not hard, you can refer to #366 and Docs-Developing section. In short, it needs to …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@henrywood
Comment options

Answer selected by henrywood
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants