Search

Language:  
Search for:

Available article translations:

[HOWTO] How to process files with .html extension through PHP (Linux)

Article ID: 115773, created on Mar 21, 2013, last review on Aug 12, 2014

APPLIES TO:
  • Plesk Automation 11.5

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.conf file 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. For more information, check KB article #115277.

Instructions for processing HTML files by PHP for Plesk for Windows are available in KB article #115774.




33a70544d00d562bbc5b17762c4ed2b3 e0aff7830fa22f92062ee4db78133079 caea8340e2d186a540518d08602aa065

FEEDBACK
Was this article helpful?
Tell us how we may improve it.
Yes No
 
 
 
 
 
 
Server Virtualization
- Odin Cloud Server
- Odin Containers for Windows 6.0
- Odin Virtuozzo Containers
Automation
- Odin Automation
- Odin Automation for Cloud Infrastructure
- Odin Business Automation Standard
- Odin Virtual Automation
- Odin Plesk Panel Suite
- Web Presence Builder
- Odin Plesk Automation
- Odin Small Business Panel
- Value-added Services for Hosters
- Odin Partner Storefront
Services & Resources
- Cloud Acceleration Services
- Professional Services
- Support Services
- Training & Certification