Answer

To process HTML pages through PHP, it is important to first determine which mode PHP is running in, and specifically, whether it is running through the Apache module as a CGI or FastCGI application. This can be done by looking at the hosting settings of the domain by clicking on the domain name on the Websites & Domains tab in the control panel.

Next, choose one of following sections, depending on the PHP execution mode, and put it in the conf/vhost.conffile in the virtual host directory. Then reconfigure the web server using this command:

/usr/local/psa/admin/sbin/httpdmng --reconfigure-all

PHP is running as an Apache module:

<IfModule mod_php5.c>
   AddHandler php5-script .php .html .htm
   AddType text/html .php .html .htm
</IfModule>

PHP is running as a FastCGI application:

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

PHP is running as a CGI application:

<Files ~ (\.html)>
    SetHandler None
    AddHandler php-script .html
    Options +ExecCGI
    allow from all
</Files>

If a change is required on a global scale, then the virtual host configuration templates can be adjusted and the sections above put into web server configuration files automatically.

Leave a Reply

Your email address will not be published. Required fields are marked *