htm文件中的php语句不会被执行,如何在html文件中运行php代码?
html文件执行php语句的方法:
1,修改httpd.conf,命令apache把html当作php,
需要修改服务器里的http.conf文件。
在apache的httpd.conf中加入以下语句:
addtype application/x-httpd-htm .htm
action application/x-httpd-htm “/php4/php.exe”
一般的虚拟主机,我们无法修改httpd.conf,但我们可以通过修改.htaccess来实现。
2,修改.htaccess
new php add handlers
solutionif you need an add handler for php please use the following:
#php5
addhandler application/x-httpd-php5 .html .htm
#php4
addhandler application/x-httpd-php4 .html .htm
that is if you need to parse .html files or any other extension as php you can place that in your .htaccess file.
以上这篇静态html文件执行php语句的方法(推荐)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持移动技术网。
如对本文有疑问, 点击进行留言回复!!
DM数据库:dm.ini参数(五)预先装载表、客户端缓存、REDO 日志、事务相关参数
php+mysql获取7天、30天的统计数据,没有数值的补充0 By勤勤学长
第一章 第六小节Duilib的WindowImplBase基类OnCreate函数中调用AttachDialog函数
网友评论