如何在Apache中以纯文本形式显示php文件

对于本地Apache服务器(与Ubuntu一起运行)上的某个文件夹,我希望所有*

php文件都将显示为好像纯文本文件一样。我需要这个,因为我只想查看这些文件的源代码而不运行它们。

在搜索时,我发现大多数人都存在相反的问题:-),并且真的找不到适合我的解决方案。

我需要在.htacces-file文件夹中包含什么?

谢谢!

回答:

答案:

在.htaccess文件类型中

php_flag engine off 

#This will prevent apache from executing *.php-files

AddType text/plain php

#this wil display php-files in browser (if not, browser will want to download file!)

感谢布拉德!

以上是 如何在Apache中以纯文本形式显示php文件 的全部内容, 来源链接: utcz.com/qa/403044.html

回到顶部