Welcome to WebmasterWorld Guest from 50.17.117.221

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Addhandler for PHP

     
10:39 pm on Oct 19, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 31, 2005
posts:114
votes: 0


Just thought I'd add, since the post I found here via Google was outdated, that there is a way to get php parsed in html docs- the .htaccess line that works is this:

AddHandler x-httpd-php5 .php .htm .html

3:16 am on Oct 20, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 12, 2005
posts:5966
votes: 0


Just be sure that this is exactly what you want; even HTML files that do not contain PHP will still be interpreted as PHP. This will cause your server to work harder than it has to :)
4:45 am on Oct 20, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 4, 2002
posts:111
votes: 0


How much harder? If there is no <?php echo "php"?> in the file, surely it has nothing to parse.
1:38 pm on Oct 20, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 12, 2005
posts:5966
votes: 0


True, but it still has to go to the PHP interpreter. If you can eliminate this entirely surely it will be less for the server to do. Especially if the site has a lot of traffic.
3:40 pm on Oct 20, 2006 (gmt 0)

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15755
votes: 0


sry eelix, no offense intended

though there is an increase, it is not noticable, even on very high traffic sites, in my experience

4:36 pm on Oct 20, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 12, 2005
posts:5966
votes: 0


Noted. Thanks

>>>no offense intended

None taken; I'm still learning too ;)

6:51 pm on Oct 24, 2006 (gmt 0)

Administrator

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
posts:12533
votes: 0


You are better off using
AddHandler php5-script php htm html

for PHP5. The difference being if you ever implement extensionless uris (as in Apache Content Negotiation [php.net]).