【发布时间】:2021-07-05 15:38:12
【问题描述】:
从 Apache (Godaddy) 迁移到 Nginx (DigitalOcean),下面 index.html 中的 PHP 代码不起作用,因此,网站的页脚部分消失了。它在旧服务器上运行良好。
<? include("includes/copyright.php") ?>
服务器详情:
Ubuntu 20.04
PHP 7.14.15
Nginx 1.18.0
sudo systemctl list-units 'php*'
【问题讨论】:
-
所以你把php代码放在.html文件里?
-
它可能正确包含它,但没有处理它,因为“父”页面是 .html,而不是 .php。
-
你能发布你的 nginx 配置吗?你在使用 php-fpm 吗?假设您是,您可以调整 security.limit_extensions 中定义的扩展名以包含 .html
-
@forloops nginx conf 已上传。
-
@droopsnoot 这在旧的 Apache 服务器上运行良好。迁移到 Nginx 后停止工作
标签: php html nginx server-side-rendering ssi