Process HTML files like PHP

后端 未结 4 1966
清酒与你
清酒与你 2020-11-29 11:17

I\'ve been trying to get .html files to process like .PHP files, using the .htaccess file. I\'ve used the following, both of which don\'t work and trying to access the test

4条回答
  •  抹茶落季
    2020-11-29 12:08

    You need to know whetheryou are using php-fpm instead of php module. If you are using php-fpm, then you have to do two things:

    1) in httpd.conf add the lines:

    
        SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost"
    
    

    2) in php-fpm.d/www.conf make sure you have the line

     security.limit_extensions =
    

    This will work. Maybe there are better settings, I don't know. I do know that if you have php-fpm, none of the answers involving AddHandler, AddType are going to work.

提交回复
热议问题