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/

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!

Leave a Reply