Jump to content


PHP SSI in .html problem

  • Please log in to reply
1 reply to this topic

#1 ajeremie

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 29 March 2006 - 08:57 PM

I am migrating to a new server and none of my old PHP SSI do work anymore.

Old config: Plesk 7.5.4 with PHP 4.3.8 running Apache 2.0.50 on Fedora
New Config: Plesk 7.5.4 with PHP 4.3.11 running Apache 2.0.53 on Fedora

The code in question is on an HTML page: 
<!--#include virtual="includes/header.php" -->
Works perfectly on old server, all the header/footer and right sections of the site are all PHP SSI, but on the new server the page will not even display. Gives a "The page cannot be displayed" error.

I have tried to replace them with SHTML on the new server and it works fine, so SSI is turned on properly. All my PHP pages of the site do work properly and all the PHP SSI on PHP pages work perfectly. Just when I have PHP SSI in .HTML files that it craps out.

I tried a bunch of .htaccess edits but none of them fully satisfied me as they either serve the HTML page with the PHP SSI but then non of the stand alone PHP pages worked anymore or even worse I get asked to download the file.

I have tried (without success) the following in the .htaccess:

AddType application/x-httpd-php .html
Give out a: "The page cannot be displayed" error


text/x-server-parsed-html .html 
AddType text/x-server-parsed-html .htm
Gives me a: "500 Internal Server Error"

Also tried:

AddHandler application/x-httpd-php .php .html .htm
But then it only parses half the page.

Some people suggested that I needed in my httpd.conf file:

AddType text/html .shtml 
AddHandler server-parsed .shtml 
AddHandler server-parsed .html 
XBitHack On 

AddType text/html .shtml 
AddOutputFilter INCLUDES .shtml .html
My httpd.conf file is already set that way. My belief is that it can be solved with an edit on the .htaccess but cannot find the good combo of edits to make it all work as before.

Since the site is well indexed and ranked by search engine, converting all my pages to PHP is not an option. Changing to SHTML all the includes is not an option either as I have dynamic script in the PHP includes.

If you believe you can be of help to solve the problem please let me know.

- Jeremie

#2 ajeremie

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 30 March 2006 - 04:03 PM

[!--quoteo(post=359813:date=Mar 29 2006, 03:57 PM:name=Jeremie)--][div class=\'quotetop\']QUOTE(Jeremie @ Mar 29 2006, 03:57 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
AddHandler application/x-httpd-php .php .html .htm
But then it only parses half the page.
After some suggestions form another forum I dod as follow to make it all work:

Since the HTML is now parse PHP let's forget about SSI and include the PHP as PHP within the HTML

It did it.

Problem solved.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users