PHP in HTML (again, but for 1 site only)

You also need to:

1.- Edit php-fpm conf file for your domain. It should be here:

And add at the end of file this directive.
security.limit_extensions = .htm

Save the file and restart php service.
systemctl restart php8.2-fpm

2.- Edit nginx conf files (both, normal and ssl)


And remove htm extension from both conf files:


location ~* ^.+\.(css|htm|html|js|json|xml|[...]


location ~* ^.+\.(css|html|js|json|xml|[...]

Restart nginx:

systemctl restart nginx

And as you already modified apache2.conf:

    <FilesMatch \.htm$>
        SetHandler "proxy:unix:/run/php/|fcgi://localhost"

It should work fine now.

Note: Once you check whether it works, you would need to create customized php, nginx and apache templates for your domain with all these changes or the conf will be overwritten when rebuilding the web domain.