> > I am having a nightmare trying to get some PHP into the output of
> > a Perl script. PHP. I've heard rumours of Apache 2.0 allowing multiple
> > filters, which would be perfect when it's out, but not yet obviously.
>
> Add PHP support to your server, and use subrequests to get the
> results of the processing. Or, run PHP on another server, and
> use LWP to fetch pages from that server which will be included
> the output fromt he main server.
Running PHP elsewhere is out of the question, as both the PHP and Perl
code uses data stored on the system. By 'Add PHP support', if you mean
adding PHP such that I can write and serve .php documents, then this
is already in place, as most of the site is in PHP!, but if you mean
something other than this... please explain more ?
'and use subrequests to get the results'
Sorry for sounding stupid, but what exactly do you mean... ? I am
calling the PHP CGI binary from inside Perl to get output, and it works
fine from a shell, but not through Apache. Do you mean using lynx to
fetch a page on the server to a file and use that.. ?
That is the only solution I have found to date, calling lynx -dump with
a http://localhost/ address to get Apache to return the PHP file to me,
with all the correct PHP expansion. I can then read this output using the
perl script and include it in my perl output, back to the browser.
The problem comes in that I want to specify a host of different PHP
commands in my Perl output, and get Apache to process them on the way
back, so using this trick, I have to create (from the perl script) a bunch
of temporary files containing PHP, somewhere (now globally writable) under
the DOCUMENT_ROOT tree, fetch them using lynx again needing to use a writable
area (although /tmp is fine here), and then include them in my output, and
then clean up the files!
There must be an easier way !!!
Please help me... I've spent over 20 hours reading nearly every forum
on phpbuilder.net and a whole host of other sites now, and I've found
two others who have exactly the same problem as me, and having emailed them,
they never found an elegant solution... they ended up re-writing all their
code in one or the other.
But I've got over 40,000 lines of Perl, and the entire rest of the site is
in PHP, so this is an unbelievable task if I have to resort to it !?!?!?
Help ???
J.