in reply to Make PHP Execute in CGI output

Apache 2.0 will make this much easier. Until then something else to perhaps try is placing mod_cgi before mod_php in your module_list (before means @ the bottom), to give it a higher precedence. Usually mod_php gets executed long before mod_cgi.

--
perl -p -e "s/(?:\w);([st])/'\$1/mg"