我正在使用 Apache 运行 Ubuntu 服务器。 PHP 和 HTML 都可以使用各自的文件扩展名正确运行。当我尝试将 PHP 代码添加到 HTML 文件中时,当我在 httpd.conf 中使用以下内容时,它会呈现 PHP,但不会呈现 HTML
AddHandler application/x-httpd-php .html
有什么建议吗?
最佳答案
header('Content-Type: text/plain');
在 PHP 代码中并抛弃了一切!
关于php - Apache 服务器: can't render php and html at once,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9222642/