Hi,
I'm have created an extension for PHP5 in Windows.
My problem is that the installed version of PHP5 must match exactly the source against which my extension was compiled,
or my extension is not loaded at all.
It seems to me that this means that I must have exactly as many extensions compiled as there are PHP5 versions,
even if if I'm quite sure that the same extension dll should work on other PHP5 versions than the one it was compiled on.
Is there a way in PHP5 to disable the very strict version checks, even if just for testing?
Thanks in advance.
Howto use same extension on different PHP5 versions
Moderator: General Moderators
- markusn00b
- Forum Contributor
- Posts: 298
- Joined: Sat Oct 20, 2007 2:16 pm
- Location: York, England
Re: Howto use same extension on different PHP5 versions
Compile your extension under PHP4 - just like you do for PHP5.harrym wrote:Hi,
I'm have created an extension for PHP5 in Windows.
My problem is that the installed version of PHP5 must match exactly the source against which my extension was compiled,
or my extension is not loaded at all.
It seems to me that this means that I must have exactly as many extensions compiled as there are PHP5 versions,
even if if I'm quite sure that the same extension dll should work on other PHP5 versions than the one it was compiled on.
Is there a way in PHP5 to disable the very strict version checks, even if just for testing?
Thanks in advance.
However, ZE1 (Zend Engine 1) differs quite a lot from ZE2, so you may encounter some difficulty geting an extension written under ZE2 (PHP5) to compile for ZE1 (PHP4). As far as I can recall, ZE2 does provide BC (backwards compatibility) for extensions developed under ZE1, but I doubt you can get ZE2 extensions to work (easily) with ZE1.
Mark.
Re: Howto use same extension on different PHP5 versions
For some reason I can't use an extension compiled on 5.3.0 on 5.2.9.
Is that normal?
Is that normal?
Re: Howto use same extension on different PHP5 versions
Yes. 5.3 is very different from 5.2. It resembles PHP 6 more than it does PHP 5.harrym wrote:For some reason I can't use an extension compiled on 5.3.0 on 5.2.9.
Is that normal?
- markusn00b
- Forum Contributor
- Posts: 298
- Joined: Sat Oct 20, 2007 2:16 pm
- Location: York, England
Re: Howto use same extension on different PHP5 versions
Much for the same reasons I mentioned before - an extension compiled on PHPx will not work for PHP<x.harrym wrote:For some reason I can't use an extension compiled on 5.3.0 on 5.2.9.
Is that normal?
Re: Howto use same extension on different PHP5 versions
Thanks for the answer - I now start seeing the light. PHPx and higher is workable!
So let me ask the opposite question: If I compile with PHP5.0, will it work for all 5.x?
Or which is the lowest PHP5.y which will work with 5.3 and 5.2.
And the same question for PHP4 (or I may restrict the extension to PHP5).
So let me ask the opposite question: If I compile with PHP5.0, will it work for all 5.x?
Or which is the lowest PHP5.y which will work with 5.3 and 5.2.
And the same question for PHP4 (or I may restrict the extension to PHP5).
- markusn00b
- Forum Contributor
- Posts: 298
- Joined: Sat Oct 20, 2007 2:16 pm
- Location: York, England
Re: Howto use same extension on different PHP5 versions
In fact, after talking to the PHP developers, for example, an extension compiled on 5.2.0 will only work on the 5.2.x range of releases. The minor version is increased when a binary incompatibility exists, hence why you cannot compile on a newer/older build.harrym wrote:Thanks for the answer - I now start seeing the light. PHPx and higher is workable!
So let me ask the opposite question: If I compile with PHP5.0, will it work for all 5.x?
Or which is the lowest PHP5.y which will work with 5.3 and 5.2.
And the same question for PHP4 (or I may restrict the extension to PHP5).
This is generally why we provide the source code, makefiles, etc., to the user so they can build the extension on their PHP.
Re: Howto use same extension on different PHP5 versions
This is a big problems for us developers - the too strict version check.
Under Windows we have:
2 compilers : VC6 & VC9
x versions : 5.0 5.1 5.2 5.3 4.4 4.3 4.2 4.1 4.0 (let's stop here) = 9 versions
2 flavors : Release and Debug.
That's assuming we restrict ourselves to the TS version.
Total : 2 x 9 x 2 = 36 (!)
Now just try and calculate the amount of time spent on maintaining all these versions.
And all this just for Windows. We haven't yet tried to port to Linux.
This multiplicity of versions is very simply unmanageable.
My company is not large, and what we're finding out about the maintenance costs
of furnishing a PHP extension is really very very frightening.
Under Windows we have:
2 compilers : VC6 & VC9
x versions : 5.0 5.1 5.2 5.3 4.4 4.3 4.2 4.1 4.0 (let's stop here) = 9 versions
2 flavors : Release and Debug.
That's assuming we restrict ourselves to the TS version.
Total : 2 x 9 x 2 = 36 (!)
Now just try and calculate the amount of time spent on maintaining all these versions.
And all this just for Windows. We haven't yet tried to port to Linux.
This multiplicity of versions is very simply unmanageable.
My company is not large, and what we're finding out about the maintenance costs
of furnishing a PHP extension is really very very frightening.