• Skip to main content
  • Skip to primary sidebar

AllScoop

Gadgets - PHP Code - ASP Code - Web Tools - Technology

PHP-FPM parse .htm or .html files.

Leave a Comment

In order to get the PHP-FPM process to parse files other than PHP, I followed these steps below.

Edit the Apache Conf file for the website in question as follows:
REMOVE the line below in red (best way is just put # in front of the line, so it’s still there)

<FilesMatch \.php$>

Change the top line as follows:

<FilesMatch \.(php|phar|htm)$>
    SetHandler proxy:fcgi://localhost:8006
</FilesMatch>

Next, you need to edit the PHP-FPM conf file for the website specifically.

I was using Virtualmin on Ubuntu 20.04, so that file was located here:
/etc/php/8.1/fpm/pool.d/

PHP FPM Conf Files

Inside that folder were individual .conf files for each website. If you are using Virtualmin, this will be your “<domain ID>.conf”
(or Virtualmin domain -> services ->php-fpm configuration.)

I added the following line to the end of this file. My goal was “.htm” files to be read as PHP.

security.limit_extensions = .php .php3 .php4 .php5 .php7 .htm

My “1640832995142367.conf” looks like below:

[1640832995142367]
user = example
group = example
listen = localhost:8006
pm = dynamic
pm.max_children = 20
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 5
php_admin_value[upload_tmp_dir] = /home/example/tmp
php_admin_value[session.save_path] = /home/example/tmp
security.limit_extensions = .php .php3 .php4 .php5 .php7 .htm

Remember to restart your PHP-FPM service!

Filed Under: code, php code Tagged With: apache, php-fpm, virtualmin, webmin

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar

Categories

  • allscoop
  • antenna
  • appliance repair
  • asp scripts
  • bots
  • cars
  • code
  • ecommerce
  • hardware
  • misc
  • mobile
  • news
  • other stuff
  • php code
  • projects
  • seen on tv
  • shopping cart
  • software
  • technology
  • the web
  • tools
  • wordpress

Blogroll

  • Cartridge Library

Resources

  • Cool Stuff
  • Ohio Business
  • Timeclock Software
  • Wiper Blades

Pages

  • 1&1 Business Package Review
  • About AllScoop

Copyright © 2022