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 ?
Thanks
James
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.
damn.
ok, well how do i get the effect of SSI to run a script.
at the moment i have this :
<!--#include virtual="/stato/stats.cgi"-->
how can i get this effect in PHP ?
<?php require("/stato/stats.cgi"); ?>
is it that ?
Normally, you'd just do:
include('filetoinclude.php');
But since the file you're including is a CGI that must be processed, you should instead use
passthru('/path/to/script.cgi');
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">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
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
virtual();
this works fine.
thanks
james
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.
Guess I'll have to use the javascript image tag version. But this messes up the layout. Doh !
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks