【发布时间】:2013-11-28 17:50:07
【问题描述】:
index.htm 我有 6 行 PHP 代码不会在我的页面上运行我没有收到任何类型的错误,如果你查看源代码它就不会运行它显示我的原始 PHP。我有一个名为test.php 的文件可以正常工作。在 test.php 我只有那 6 行代码,你可以在我的 index.htm 中看到
Server Name defiro
cPanel Version 11.36.2 (build 9)
Theme x3
Apache version 2.2.24
PHP version 5.2.17
MySQL version 5.5.30-30.2
Architecture x86_64
Operating system linux
我尝试通过将AddType application/x-httpd-php .html 放入我的网站.htaccess 文件中来解决问题,如PHP not working on HTML file 中列出的那样>
编辑__
它不会让我在一个文件中同时使用 php 或 html,无论它是 .html 还是 .php 它都不起作用我不知道如何修复它?
【问题讨论】:
-
服务器正在查看文件扩展名 - 除非扩展名是
.php(并且您尝试配置.html而不是.htm),否则不会调用 PHP。 -
您说您希望 .htm 页面与 php 一起使用但为 .html 添加规则?
-
我之前在 html 文件中使用过 php 和 html 应该没有问题,但是我不能在任何文件中同时使用 html 或 php,无论是 .php 文件还是 .htm / .html
-
“我不能在任何文件中同时使用 html 或 php,无论它是 .php” - 那么这个 php 页面是如何生成 html 的呢? mingamez.com/test.php
-
"因为它正在发出请求" 没有意义.. 网络上的一切都是请求。