Forum Moderators: coopster
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
Code:
The code in question is on an HTML page:
<!--#include virtual="includes/header.php" -->
Works perfectly on old server: <snipped url per TOS [webmasterworld.com]> 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.
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.
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.
Cheers,
- Jeremie
[edited by: coopster at 2:36 pm (utc) on Mar. 29, 2006]
[edit reason] removed url per TOS [webmasterworld.com] [/edit]
But the:
<<<
AddType application/x-httpd-php .html
>>>
Does not do it on the new server. It still does not show anything.
I also tried the following:
<<<
text/x-server-parsed-html .html
AddType text/x-server-parsed-html .htm
>>>
That edit in the .htaccess gives me a "500 Internal Server Error"
Any other idea?
Note: I compared my old http.conf files and the only difference is that the old one has:
LoadModule webapp_module modules/mod_webapp.so
and the new one has:
#LoadModule webapp_module modules/mod_webapp.so
It works perfectly and since I was anyway parsing PHP code on all of my pages, it does not even slow down the server anymore than it was before.
Kind of floored by it but will take it and run with it. I will post shortly the problem and work around on the apache section, as well as all the other board I have been asking for it.
Cheers,
- Jeremie
The answer is, as henry stated, in message 8.
use php includes.
There is a thread that describes in detail how you can do both and I will post the link here just so you can read about how it is done, for peace of mind:
When parsing SSI's, PHP files don't work [webmasterworld.com]
That link and the links from that page describe in detail how SSI works, and how you can implement both SSI and PHP together.
But, save yourself the headaches, use php includes().