How to add MIME types and run .html files as PHP
MIME Types & Handlers controls how a website sends and runs its files: which content type a file extension is sent with, which extensions run as PHP, and whether CGI scripts run in cgi-bin. Use it instead of AddType and AddHandler lines in .htaccess, which are not applied here.
Add a MIME type
- Log in to the control panel (
https://<server>:2083). - Open MIME Types & Handlers in the menu (section Advanced).
- Choose the website at the top and click Show.
- Under MIME types, enter the Extension without the dot (for example
webmanifest) and the Type (for exampleapplication/manifest+json). - Click Add.
You see MIME type saved. It applies within a minute. To undo it, click Remove in its row.
Run other extensions as PHP
Old sites sometimes keep PHP code in .html pages.
- On the same page, under Handlers, tick the extensions to run as PHP:
.html,.htm,.shtml,.phtml,.php5,.php7or.inc. - Click Save.
The setting applies within a minute, for that website only.
Run CGI scripts
- Under Handlers, tick Run CGI scripts in
cgi-bin/. - Click Save.
- Put the script in the
cgi-binfolder of the website. Its first line names the interpreter, for example#!/usr/bin/perl. - Make the script executable: set its permissions to
755in the File Manager.
Good to know
- Up to 50 MIME types per website. Extensions are 1–10 lowercase letters or digits.
- PHP extensions (
php,htmland the others above) cannot be given a MIME type; use Handlers for them. - Running
.htmlas PHP makes every.htmlpage pass through PHP, which is a little slower. Turn it on only when the site needs it. - If the page shows These settings need the built-in web server; this server uses another one., your server cannot apply them; contact your hosting provider.
Common questions
Do these settings apply to all my websites?
No. MIME types and handlers are set per website. Choose each website at the top of the page and save its own settings.
Can I make images run as PHP?
No. Only the extensions listed under Handlers can run as PHP, never images or other uploaded media.
Thank you — this helps us improve the article.
Still stuck?
Ask the AI about your exact situation — it answers from this knowledge base — or contact us.
Related articles
- Which .htaccess rules work on your hosting
What the web server reads from .htaccess: rewrite rules, Deny/Require lines, Files blocks and php_value settings, what is ignored, and how fast changes apply.
- How to change the PHP version of your website
Choose the PHP version for your whole hosting account or for one domain only, see which versions are installed, and what to check after switching.
- How to change file and folder permissions (chmod)
Change file permissions in the File Manager (644 for files, 755 for folders), what the numbers mean and how to fix 403 Forbidden after a change.