• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Plesk index.html php not working

NakHyun Kim

New Pleskian
Hello.

It's my first time using Plesk.

I have a problem.

Php grammar does not work in index.html

No matter how hard I looked, I couldn't find a definite solution.

Have a nice day.
 
Create a text file named ".htaccess" in the document root directory of your website. Enter the following line. If an .htaccess-file already exists, add the line to that file:


AddHandler php-script .html .htm


By using this line the web server knows that it ought to parse .html and .htm files for PHP code and that it ought to interpret <?php…?>-segments as PHP commands. Please note that this .htaccess command will work on Bitpalace shared hosting web space, but may not work on web space of other providers.


Then add the following lines to the "Additional configuration directives" section with the PHP icon in the webspace control panel:


[php-fpm-pool-settings]
security.limit_extensions = .php .phar .html .htm .inc


Add the following additional lines to the "Additional directives for HTTP" and "Additional directives for HTTPS" sections in the "Apache and nginx settings" icon in the webspace control panel:


If you are using the PHP-FPM interface (recommended):


<IfModule mod_proxy_fcgi.c>
<Files ~ .(?i:inc|html|htm)$>
SetHandler proxy:unix:///var/www/vhosts/system/example.com/php-fpm.sock|fcgi://127.0.0.1:9000
</Files>
</IfModule>


(Replace „example.com“ by your domain name.)


If you are using the PHP-FastCGI interface:


<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>

The changes need a webserver reload/restart to become active.
 
Back
Top