本篇内容主要讲解“html是不是静态页面”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“html是不是静态页面”吧!html是静态页面;html表示结构,c
顺晟科技
2022-09-15 22:18:42
197
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.
02
2022-10
15
2022-09
15
2022-09
15
2022-09
15
2022-09
15
2022-09