Dynamic linking non-zend extensions and how to statically link with a zend extension ? #369
-
I just stumbled upon static-php-cli. Looks promising and cool. Now for my questions:
Thanks for your effort on static-php-cli ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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.
For normal extension, not hard, you can refer to #366 and Docs-Developing section. In short, it needs to add But I haven't added external Zend extensions yet. The only supported zend extension for SPC is Opcache. The Opcache support is done thanks to phpmicro's patch. If you are implementing it this might help you |
Beta Was this translation helpful? Give feedback.
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.
For normal extension, not hard, you can refer to #366 and Docs-Developing section. In short, it needs to …