Possible to make an independent shared object of PHP?
Posted: Fri Jun 17, 2005 5:25 pm
Howdy,
I'm new to the forums and I've got a question. I've been doing some research including drudging through PHP, Apache, and apr source code to try to figure out the answer; I'll continue to do this but I figure that maybe some experienced folks have some ideas.
My desire is to load up a PHP shared object into my server project so that the server can execute PHP code like Apache does. I can build PHP with a shared object for the Apache webserver...easy, piece of cake. When I load in this shared object in my own project manually, I get this error message from the dlerror() function of the dlfcn.h stuff:
undefined symbol: ap_loaded_modules
The ap_loaded_modules stuff seems to be a pretty deep aspect of the libraries that are a part of the Apache project. I suspect that given enough time, I can probably include all of the necessary Apache source code into my own project to get this stuff working, but I'd rather not do that.
I noticed that in the PHP source directory structure that this Apache shared object interface is used in $PHP/sapi/apache2handler, specifically php_functions.c. And there isn't much of this code, so this leads me to believe that it might be possible to build a more generic PHP shared object file that I can use, avoiding the need to make use of Apache's module loading stuff.
So my question(s) is/are: Is it possible to build a generic (non-Apache dependent) shared object of PHP? If not, how might I approach the problem of making this possible?
Many thanks!
-Ray
I'm new to the forums and I've got a question. I've been doing some research including drudging through PHP, Apache, and apr source code to try to figure out the answer; I'll continue to do this but I figure that maybe some experienced folks have some ideas.
My desire is to load up a PHP shared object into my server project so that the server can execute PHP code like Apache does. I can build PHP with a shared object for the Apache webserver...easy, piece of cake. When I load in this shared object in my own project manually, I get this error message from the dlerror() function of the dlfcn.h stuff:
undefined symbol: ap_loaded_modules
The ap_loaded_modules stuff seems to be a pretty deep aspect of the libraries that are a part of the Apache project. I suspect that given enough time, I can probably include all of the necessary Apache source code into my own project to get this stuff working, but I'd rather not do that.
I noticed that in the PHP source directory structure that this Apache shared object interface is used in $PHP/sapi/apache2handler, specifically php_functions.c. And there isn't much of this code, so this leads me to believe that it might be possible to build a more generic PHP shared object file that I can use, avoiding the need to make use of Apache's module loading stuff.
So my question(s) is/are: Is it possible to build a generic (non-Apache dependent) shared object of PHP? If not, how might I approach the problem of making this possible?
Many thanks!
-Ray