Welcome, Guest
Please Login or Register.
Lost Password?
Re:PHP execution in .html files (1 viewing)
Post Reply

TOPIC: Re:PHP execution in .html files

#13602
testdog (User)
Posts: 7
graphgraph
PHP execution in .html files 2008/06/10 04:25  
I have a domain that marketing says they just have to have php running on pages with the .html extension. I am moving the site to virtualmin and cann't get it to work with mod_fcgid. On the current server I just added these lines to my .htaccess file and things worked perfectly.
RemoveHandler .html .htm
AddType application/x-httpd-php .html .htm

Can anyone help me with this issue?

Thanks
Wayne
  The administrator has disabled public write access.
#13615
Joe (Admin)
Posts: 3784
graph
Re:PHP execution in .html files 2008/06/10 11:50  
.htaccess files are quite limited, by default, as there are potential security issues opened up by broader override options. You can set AllowOverride to permit FileInfo and Options (or just "all", since those are the potentially dangerous ones anyway...might as well go whole hog), and restart Apache, and it'll respect those directives.

Or, probably safer, something like this in the httpd.conf should also do the trick:

AddHandler fcgid-script .html
AddHandler fcgid-script .htm
FCGIWrapper /home/domain/fcgi-bin/php5.fcgi .html
FCGIWrapper /home/domain/fcgi-bin/php5.fcgi .htm

Find the bit where the existing fcgid-script rules are and add them there...and, obviously, replace the "domain" bit with the actual directory where this virtual server lives.
  The administrator has disabled public write access.
#13616
Joe (Admin)
Posts: 3784
graph
Re:PHP execution in .html files 2008/06/10 11:51  
Oh, yeah, you'll probably also need the RemoveHandler .html .htm bit before those directives, if you do opt to add to the httpd.conf file.
  The administrator has disabled public write access.
#13633
SteveHeinsch (User)
Posts: 78
graphgraph
Re:PHP execution in .html files 2008/06/10 20:56  
Ive read you can do this easily with an .htaccess file with the following line in it:
AddType application/x-httpd-php .html
  The administrator has disabled public write access.
#13634
SteveHeinsch (User)
Posts: 78
graphgraph
Re:PHP execution in .html files 2008/06/10 20:56  
Ive read you can do this easily with an .htaccess file with the following line in it:
AddType application/x-httpd-php .html
  The administrator has disabled public write access.
#13640
sgrayban (User)
Posts: 536
graphgraph
Re:PHP execution in .html files 2008/06/10 21:50  
That should work
Scott Grayban
BORGNET dot US Internet Hosting
VM Pro Reseller
  The administrator has disabled public write access.
#13650
testdog (User)
Posts: 7
graphgraph
Re:PHP execution in .html files 2008/06/11 02:58  
I tried AllowOveride and AddType application/x-httpd-php .html.
I also tried putting the AddHandler stuff in my .htaccess. Neither one worked for me so I changed it in httpd.conf and it works.

Thanks Joe.
  The administrator has disabled public write access.
Post Reply
get the latest posts directly to your desktop

Talk and Get Help

Support
Forums
Bugs and Issues

Get Virtualmin

OS Support
Buy Online
Download
Copyright 2005-2007 Virtualmin, Inc. All rights reserved.