How to configure apache to process php code inside html file

Created:

2017-01-23 11:46:32 UTC

Modified:

2017-08-08 13:15:36 UTC

2

Was this article helpful?


Have more questions?

Submit a request

How to configure apache to process php code inside html file

Applicable to:

  • Plesk for Linux

Question

How to configure Apache to process php code inside html file?

Answer

1. Make sure that PHP handler type is set to Fast-CGI served by Apache at the tab Domains > example.com > PHP Settings

2. Add the following to Domains > example.com > Apache and Nginx settings > Additional  directives for http :

<IfModule mod_fcgid.c> 
<Files ~ (\.htm)>
SetHandler fcgid-script
FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .htm
Options +ExecCGI
allow from all
</Files>
</IfModule>
<IfModule mod_fcgid.c>
<Files ~ (\.html)>
SetHandler fcgid-script
FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .html
Options +ExecCGI
allow from all
</Files>
</IfModule> 

Have more questions? Submit a request
Please sign in to leave a comment.