I'm using Mason to dynamically create templated web-pages and this is all working okay, adding headers/footers/menus etc... via the autohandler and "$m->call_next" for the content.
However, I also have a number of inherited PHP scripts, the output of which I'd also like to format using my Mason components. Now, when I access those .php scripts, I get a download dialog pop-up stating that we have an unrecognised mime type etc... Ok. That's because the php is "application/x-httpd-php" rather than "text/html". (The PHP is processed okay if I add an appropriate FilesMatch/SetHandler directive for those .php files, but obviously doesn't do the Mason formatting stuff)
So, I've created a module "Apache::PHP" which uses the Apache::SubProcess module to exec the command "php -f $r->filename". This Apache::PHP is then chained to the Mason Handler, the idea being that I could parse the file using Apache::PHP, output the html to Mason which then does the wizzy formatting stuff and ta-da!. Sounds feasible I thought, but when parsing the PHP in the child process, I get a Segmentation fault... yeuch!. My guess is that somewhere within Apache there's a limit to the amount of memory a request can grab, and, in spawning php, this limit is exceeded. So, does anyone have any ideas how I can either work around this, i.e. alternatives to spawn system commands from a request, or increase the amount of memory that a request can use... All links, suggestions welcome.
System info: RH9 linux running 2.6.2 kernel on i686 with glibc 2.3.2-11.9 Apache 1.3.29 mod_perl 1.29 perl 5.8.3 php 4.3.4 Mason 1.25
Thanks in advance.
Rob
________________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com ________________________________________________________________________
-- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html