How to compile a PHP extension that will work 开发者_开发技巧on every version of PHP as well as every version of Linux?
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.
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.
That's not possible - its not even possible in java
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?
精彩评论