Re: parsing of SSI scripts.

From: Date: Thu, 04 Jul 2002 20:48:23 +0000
Subject: Re: parsing of SSI scripts.
Groups: php.general 
Request: Send a blank email to php-general+get-105508@lists.php.net to get a copy of this message
>>> I think I misunderstood your question. You have a Perl script that >>> returns HTML and SSI and you want that string, returned to PHP, to be >>> parsed by Apache, so the SSI is evaluated, right? > >> It seems that PHP is much more powerful and would completely replace the >> need for SSI. > >PHP more powerful than Perl?? I disagree violently of course. And since >this is a -HUGE- perlscript which is pretty advanced, having to re-code it >in PHP just because PHP can't have it parsed the way I want to seems like a >drag. The statement was that PHP was more powerful than SSI ! Please read more carefully before getting your knickers in a twist. :-) Everybody knows PHP and Perl are neck-and-neck on performance/feature-set :-) :-) :-) [If you want to disagree, don't do it here, please. Spam me individually, so only one person has to delete your ravings. Thanks.] As noted: Apache 1.x can *NOT* do "stacked handlers", but Apache 2.x can. So you can't have both SSI and PHP, or SSI and Perl, or PHP and Perl, or ABC and CBS (*) handling files successively. This is a design decision of Apache 1.x 'way back when. Or, probably, a non-decision by people who probably were happy as pigs in mud that they could get Apache to use PHP/Perl/SSI and didn't even think of having them as sequenced processors... Not very Un*x-like, in retrospect, but they've added in in 2.x, so what more do you want? If virtual() isn't passing the Env variables, you almost for sure can pass the ones you need yourself, somehow, some way. I don't know if http://php.net/setenv will do it, or if you'd need to stuff them into a database (if you already have a db connection open, another query is fairly cheap), or if you have to resort to Shared Memory, whose entire purpose is inter-process communication, so I'm pretty sure you could make that work. Maybe you can even do <?php virtual("whatever.ssi?x=$x&y=$y");?> You could even use http://php.net/flock and the file-system, but I sure don't recommend it. What really boggles my mind, however, is what you could possibly have done in SSI that would take more than 5 minutes to re-code in PHP... Now, Perl, yeah. I mean, it will take you weeks just read that [bleep] and figure out what it's doing... If you *really* need to take Perl output with PHP source in it, you *CAN* do: <?php $php = file('http://yourserver.com/whatever.pl?x=1&y=2') or die("Unable to process Perl part"); eval($php); ?> I don't recommend this, and it's probably a Bad Idea in 99% of the cases I can think of, but it's *possible*... Either live with the fact that your un-maintainable Perl code needs replacing, file by file, piece by piece, or keep writing more un-maintainable Perl code. :-) :-) :-) * ABC and CBS are trademarks of their respective corporations. All other trademarks are trademarks of their respective corporations. YMMV. -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#105508) next »