in reply to Make PHP Execute in CGI output

You probably could solve this problem using one of the ways suggested already, but if you care about performance of your app, don't do it. It's always slow to do this kind of interaction between multiple interpreters. You'd be better off teaching them some SSI syntax (there are modules for simulating SSI on CGI output) or in-line perl.

If you switch to mod_perl, you might be able to rig something up that would be no worse than your current CGI in terms of performance, but it's still probably not worth the trouble ultimately.