Configuring OpenLiteSpeed web server to support PHP includes on static .html pages
Instructions for setting up MIME types in OpenLiteSpeed (OLS)
Searching the internet for the query ‘how to enable PHP processing in HTML’ leads to enabling PHP parsing in OpenLiteSpeed Server and configuring the .htaccess file settings such as:
or
or AddHandler
or
Or using SetHandler
In my case, none of the above helped, so I had to find the solution in the OLS settings myself: On the left side of the admin panel, select
Server Configuration > General, In the General Settings section, click on conf/mime.properties in the MIME Settings line:
In the General > MIME Type Definition tab, click the plus (Add):
Fill in the fields in the MIME Type Entry tab with your data (Suffixes * — html, MIME Type * — application/x-httpd-php):
Save the changes (Save) and restart the OLS server using the Graceful Restart button:
That’s all! MIME Type configuration to support PHP functions like include(), require() is now set up for static .html pages, and similarly for other extensions (.htm, .tpl, and others).
Leave A Comment