• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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