Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用.htaccess将HTML更改为PHP时遇到问题_Php_Html_.htaccess - Fatal编程技术网

使用.htaccess将HTML更改为PHP时遇到问题

使用.htaccess将HTML更改为PHP时遇到问题,php,html,.htaccess,Php,Html,.htaccess,我有一个html文件加载的网站,但其中一些需要很少的PHP函数。我听说了。htaccess可以处理这个问题,我尝试了下面的代码 RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html 。。。但是,当我打开一个页面时,它会要求我下载.PHP文件,这表明您没有安装或启用mod_PHP web服务器需要知道如何处理PHP以及希望它作为PHP处理哪些文件。谢谢。你知道我是怎么做到的吗?我正在使用WHM/cPane

我有一个html文件加载的网站,但其中一些需要很少的PHP函数。我听说了。htaccess可以处理这个问题,我尝试了下面的代码

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

。。。但是,当我打开一个页面时,它会要求我下载.PHP文件,这表明您没有安装或启用mod_PHP


web服务器需要知道如何处理PHP以及希望它作为PHP处理哪些文件。

谢谢。你知道我是怎么做到的吗?我正在使用WHM/cPanel。我从来没有去过cPanel附近的任何地方。你能提供一些关于你的环境的更多信息吗?我需要启用mod_php。我无法做到这一点,因为我的WHM/cPanel没有mod_php作为选项