I have a project where I need to have both Apache SAPI (shared) and
embed SAPI (shared) compiled/active at the same time. Is that possible
to do at all? Any risk of symbol clashes or other similar problems?
Andrei posted this a while ago, but nobody replied and we have learned
this is it not possible.
With the current state of the code and configuration system what would
it take to do something like this:
Core PHP code is built into libphpX.so (libphp4.so)
All SAPI's require libphpX.so:
libphpX_apache.so <- apache sapi
libphpX_embeded.so <- apache sapi
and the command line sapi would have a depenency on libphpX.so.
Brian
Andrei posted this a while ago, but nobody replied and we have learned
this is it not possible.With the current state of the code and configuration system what would
it take to do something like this:Core PHP code is built into libphpX.so (libphp4.so)
All SAPI's require libphpX.so:
libphpX_apache.so <- apache sapi
libphpX_embeded.so <- apache sapiand the command line sapi would have a depenency on libphpX.so.
I guess not too many people are interested in something like this..
- Andrei
Andrei posted this a while ago, but nobody replied and we have learned
this is it not possible.With the current state of the code and configuration system what would
it take to do something like this:Core PHP code is built into libphpX.so (libphp4.so)
All SAPI's require libphpX.so:
libphpX_apache.so <- apache sapi
libphpX_embeded.so <- apache sapiand the command line sapi would have a depenency on libphpX.so.
I guess not too many people are interested in something like this..
I remember a thread about this about a year ago. Sascha's answer was
something along the lines of 'build it twice if that's what you want'.
Can't find the thread though.
George
Hello Brian,
Monday, January 26, 2004, 10:37:56 PM, you wrote:
I have a project where I need to have both Apache SAPI (shared) and
embed SAPI (shared) compiled/active at the same time. Is that possible
to do at all? Any risk of symbol clashes or other similar problems?
Andrei posted this a while ago, but nobody replied and we have learned
this is it not possible.
With the current state of the code and configuration system what would
it take to do something like this:
Core PHP code is built into libphpX.so (libphp4.so)
All SAPI's require libphpX.so:
libphpX_apache.so <- apache sapi
libphpX_embeded.so <- apache sapi
and the command line sapi would have a depenency on libphpX.so.
Sounds nice to me. But are you willing to work out a patch for that so that
we can play with it? Or do you anyone in mind who could do that change and
has some time for it?
Best regards,
Marcus mailto:helly@php.net
I have a project where I need to have both Apache SAPI (shared) and
embed SAPI (shared) compiled/active at the same time. Is that possible
to do at all? Any risk of symbol clashes or other similar problems?Andrei posted this a while ago, but nobody replied and we have learned
this is it not possible.With the current state of the code and configuration system what would
it take to do something like this:Core PHP code is built into libphpX.so (libphp4.so)
All SAPI's require libphpX.so:
libphpX_apache.so <- apache sapi
libphpX_embeded.so <- apache sapiand the command line sapi would have a depenency on libphpX.so.
Here's what I came up with:
http://www.php.net/~jani/patches/multi_sapi_build.patch
With the patch applied, I'm now able to build at least
apache, cli, cgi and embed SAPIs on one run.
# ./configure --disable-all --with-apxs --enable-embed
(CLI and CGI are build by default..)
I build them using static 'core' lib as I dislike the
idea of having to install and maintain several libs. :)
But if someone insists, it's possible to build one shared
lib too..I actually tested with that first. :)
--Jani
Here's what I came up with: http://www.php.net/~jani/patches/multi_sapi_build.patch With the patch applied, I'm now able to build at least apache, cli, cgi and embed SAPIs on one run. # ./configure --disable-all --with-apxs --enable-embed (CLI and CGI are build by default..) I build them using static 'core' lib as I dislike the idea of having to install and maintain several libs. :) But if someone insists, it's possible to build one shared lib too..I actually tested with that first. :)
Does your patch just build multiple SAPIs as separate shared libs or
does it make one shared lib that has multiple SAPIs in it? The latter is
what I want.
The best (ideal) result would be to have one libphp[45].so that contains
the core. The SAPIs should link against it, so we'd have libphpembed.so,
libphpapache.so, etc. Can this be done?
- Andrei
At 17:40 27.01.2004, you wrote:
Here's what I came up with: http://www.php.net/~jani/patches/multi_sapi_build.patch With the patch applied, I'm now able to build at least apache, cli, cgi and embed SAPIs on one run. # ./configure --disable-all --with-apxs --enable-embed (CLI and CGI are build by default..) I build them using static 'core' lib as I dislike the idea of having to install and maintain several libs. :) But if someone insists, it's possible to build one shared lib too..I actually tested with that first. :)
Does your patch just build multiple SAPIs as separate shared libs or
does it make one shared lib that has multiple SAPIs in it? The latter is
what I want.The best (ideal) result would be to have one libphp[45].so that contains
the core. The SAPIs should link against it, so we'd have libphpembed.so,
libphpapache.so, etc. Can this be done?
Would be great. The only thing is: We must compile all SAPIs with ZTS
enabled... But thats the same on windows.
Uwe Schindler
thetaphi@php.net - http://www.php.net
NSAPI SAPI developer
Erlangen, Germany
Would be great. The only thing is: We must compile all SAPIs with ZTS
enabled... But thats the same on windows.
Well, maybe we can have a ZTS and a non-ZTS version of the core lib.
- Andrei
Would be great. The only thing is: We must compile all SAPIs with ZTS
enabled... But thats the same on windows.Well, maybe we can have a ZTS and a non-ZTS version of the core lib.
That seems like a nice standard way of handling it.
George
That is also how the new win32 build system handles it;
you have the option of php5ts.dll or php5.dll.
--Wez.
Would be great. The only thing is: We must compile all SAPIs with ZTS
enabled... But thats the same on windows.Well, maybe we can have a ZTS and a non-ZTS version of the core lib.
That seems like a nice standard way of handling it.
Would be great. The only thing is: We must compile all SAPIs with ZTS
enabled... But thats the same on windows.Well, maybe we can have a ZTS and a non-ZTS version of the core lib.
Yes, but it makes no sense to build both on same run as you'd
have to build the core objects twice..
--Jani
Here's what I came up with: http://www.php.net/~jani/patches/multi_sapi_build.patch With the patch applied, I'm now able to build at least apache, cli, cgi and embed SAPIs on one run. # ./configure --disable-all --with-apxs --enable-embed (CLI and CGI are build by default..) I build them using static 'core' lib as I dislike the idea of having to install and maintain several libs. :) But if someone insists, it's possible to build one shared lib too..I actually tested with that first. :)
Does your patch just build multiple SAPIs as separate shared libs or
does it make one shared lib that has multiple SAPIs in it? The latter is
what I want.
It creates a static libphp5_core.a which is linked to each build
SAPI module / binary. Dunno how you could have same lib loaded
by e.g. Apache / Apache2 ?? Or what did you mean? :)
The best (ideal) result would be to have one libphp[45].so that contains
the core. The SAPIs should link against it, so we'd have libphpembed.so,
libphpapache.so, etc. Can this be done?
My first tests had the libphp5_core lib as shared..so yes.
I'll update my patch a bit.
--Jani
It creates a static libphp5_core.a which is linked to each build SAPI module / binary. Dunno how you could have same lib loaded by e.g. Apache / Apache2 ?? Or what did you mean? :)
The best (ideal) result would be to have one libphp[45].so that contains
the core. The SAPIs should link against it, so we'd have libphpembed.so,
libphpapache.so, etc. Can this be done?My first tests had the libphp5_core lib as shared..so yes. I'll update my patch a bit.
Okay, is it possible to make the same patch for php4?
- Andrei
It creates a static libphp5_core.a which is linked to each build SAPI module / binary. Dunno how you could have same lib loaded by e.g. Apache / Apache2 ?? Or what did you mean? :)
The best (ideal) result would be to have one libphp[45].so that contains
the core. The SAPIs should link against it, so we'd have libphpembed.so,
libphpapache.so, etc. Can this be done?My first tests had the libphp5_core lib as shared..so yes. I'll update my patch a bit.
Okay, is it possible to make the same patch for php4?
I didn't try, but I think the same patch might even apply
without modifying it at all. :)
The build stuff is pretty much same in both HEAD and PHP_4_3
branches, AFAICT.
--Jani