How to compile PHP extensions cross-version?

丶灬走出姿态 提交于 2020-01-06 12:52:33

问题


How to compile a PHP extension that will work on every version of PHP as well as every version of Linux?


回答1:


You'll need to compile it once for every platform (a Windows library won't run on GNU/Linux, just as well as a 64-bit library won't run in a 32-bit environment). If this is what you are trying to do, the answer is: it's impossible.




回答2:


You won't be able to create a "compatible with everything" binary package.

To allow for maximum compatibility I'd recommend that you package the file in a tarball with a package.xml file in the same way that PECL packages are distributed. This would allow someone to easily compile/install the package anywhere.




回答3:


That's not possible - its not even possible in java




回答4:


I have asked a similar question and was given a very sensible suggestion:

How to build a PHP extension that runs in many PHP versions?



来源:https://stackoverflow.com/questions/6041511/how-to-compile-php-extensions-cross-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!