have .html files run as .php

A client ran into an interesting problem to get .html files parsed as .php. It was not enough to add a .htaccess directive for php-script because then the php.ini file was used out of the /etc directory instead of the domain’s custom php.ini file. He had to do the following.

I was researching the problem and finally figured out the answer. Just in case you ever get asked again, I added the following to my .htaccess file and now works with the right php.ini file.

AddHandler php-script .html

SetHandler fcgid-script
FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .html
Options +ExecCGI

Originally I only had the “AddHandler php-script .html” in the .htaccess file which made it work, but did not pull in the right php.ini file.

Thanks Robert!

Robert Thaller | Net-Flow Corporation
1556 First Street, Suite 103, Napa, CA 94559
Phone 707-259-1233
Fax 707-255-7218

Posted in Uncategorized.