How to parse PHP syntax in a .html file on server?

后端 未结 4 700
一向
一向 2021-01-22 07:29

This feels like an extremely n00b question, but here goes...

I have a series of HTML files with a small amount of HTML content inside each (exported from a live system).

4条回答
  •  不要未来只要你来
    2021-01-22 07:35

    If you can't modify the server's setup, then you're SOL. You have to tell the server that .html files should be treated as PHP scripts. There's no way around this. It won't magically start sending them through the PHP parser unless you tell it to.

    On an Apache setup, it's a matter of putting in a configuration directly, such as

    AddType application/x-httpd-php .php .htm .html
    

提交回复
热议问题