Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Parsing .html files for php code' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Parsing .html files for php code
Authored by: aranor on May 30, '03 05:41:06PM

I'd just like to note that the problem with parsing .html files for either SSI or PHP is that it slows down the serving of every single HTML page on the site regardless of whether it actually contains any SSI or PHP code, simply because every page has to be parsed for it now.



[ Reply to This | # ]
Parsing .html files for php code
Authored by: Beernd on May 31, '03 04:15:37AM

That's true, though it depends on your server how important this is.
To overcome this problem, one could put XBitHack on in httpd.conf. From then on, all files with their executable bit set will be server-parsed, and the others won't. That way you don't have to rename all the files containing SSI to their .shtml equivalent, you only need to set their x bit (chmod a+x file.html), and still not every .html file is parsed.

---
"Perhaps nothing is quite true, and not even that!"
Multatuli, Ideen 1

[ Reply to This | # ]

Parsing .html files for php code
Authored by: eo on May 31, '03 10:01:47AM

At the cost of using *slightly* more CPU time, I had PHP parse HTML files, and I turned on output compression with PHP. This had the overall effect of speeding up the site and using less bandwidth. I guess I could have just used mod_gzip to have Apache serve compressed files, but I also needed to add PHP code to thousands of HTML files without renaming them.



[ Reply to This | # ]