Viewing Article

No StarNo StarNo StarNo StarNo Star | Nov 8 2013, 1:37 PM | Print
Enable PHP to parse .htm and .html
When using FastCGI to execute PHP which is the default option in newer versions of Plesk, the following options in your .htaccess file will no longer work.

AddType application/x-httpd-php .php .htm .html
AddHandler application/x-httpd-php .php .htm .html
This is because PHP is not being executed via the Apache Module functionality.

We can either move you back to Apache module or you can use the code below.
It is best to stay on FastCGI as that allows scripts to run under your own context (username) instead of "apache".  This allows you to not need to set world-writable permissions as the default 644 (files), 755 (directories) will work.

This is what you need in your .htaccess file

---Copy below this line---

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

---Copy above this line---

Alternatively, we may be able to enable this in the global configuration for your site, but using .htaccess will allow you to alter this behavior as needed.