对于我本地 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!)
感谢布拉德!
关于php - 如何在 Apache 中将 php 文件显示为纯文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4236951/