I need apache to parse *.html and *.php for PHP & SSI.
What should i add ?
at the moment i have :
AddType application/x-httpd-php3 .php
AddType application/x-httpd-php3 .html
addType text/x-server-parsed-html .html
When i use a .html, it doesn't parse for php.
What should the correct code be ?
To my knowledge, you can't parse a single file type for both PHP and SSI. You'll have to choose one or the other.
ok, well how do i get the effect of SSI to run a script.
at the moment i have this :
how can i get this effect in PHP ?
<?php require("/stato/stats.cgi"); ?>
is it that ?
Normally, you'd just do:
But since the file you're including is a CGI that must be processed, you should instead use
that isn't by any chance only PHP4 ?
No, but it's only on the Apache module version of PHP (i.e. won't work with the CGI version).
What problem(s) are you having?
well, it just returns a page with this code :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
Instead of what Statomatic should return, which is this :
<!-- Statomatic v2.2 -->
The code I'm using is :
<?php passthru("/stato/stats.cgi"); ?>
OK, passthru wasn't working.
I asked someone in #php on efnet, and they suggested using
this works fine.
using virtual(); seems to work, but i seem not to be getting some of the stats. eg referer.
is this because of not using SSI ? would using this method provide exactly the same method as using SSI ?
It's quite possible that some of the request-specific environment variables are not available to a CGI called with virtual(). This function is equivalent to <!--#include virtual...--> using SSI.
In an ideal world, you would port your CGI to PHP; however, I assume this is beyond your experience?
Unfortunately not. Plus, its a pre-compiled C++ script.