Problems with Apache, PHP, FastCGI, and includes

Status
Not open for further replies.

Lord Pachelbel

Ars Praefectus
5,499
Subscriptor++
How can I get this kind of include to work?

Within an .html file (the server is parsing it for SSI statements):
Code:
<!--#include virtual="/path/to/file.php"-->
Any time a statement like that is used, IE reports that "Internet Explorer cannot display the webpage," Firefox reports that "The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression," and Chrome reports "Error 330 (net::ERR_CONTENT_DECODING_FAILED): Unknown error."

I think it has to do with whether PHP is compiled into Apache as a module or if PHP is invoked using FastCGI. I've used include statements like the one above all the time, but now I'm trying to get them to work in a different hosting environment. I compared the output of phpinfo() from both servers, and this new server is using FastCGI.

FWIW, includes that load other .html files work fine, and other server-side statements work such as <!--#config timefmt="%Y"--><!--#echo var="DATE_LOCAL"--> which outputs 2010.


Is there a way to get this kind of include to work with FastCGI?
 

Lord Pachelbel

Ars Praefectus
5,499
Subscriptor++
I've discovered that includes going the other way don't work, either, when PHP isn't an Apache module:

Code:
<?php virtual("/path/to/file.html"); ?>
I have to instead use the include() function, and that won't work unless the site's public_html directory is part of PHP's list of include paths, which means I have to set the path at runtime or edit php.ini.

Bah!
 
Status
Not open for further replies.