如何显示的PHP文件作为Apache中的纯文本 [英] How to show php-files as plain text in Apache
本文介绍了如何显示的PHP文件作为Apache中的纯文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的本地Apache的服务器上的某个文件夹(在Ubuntu上运行)我想是因为如果他们是纯文本文件中的所有* PHP的文件将显示。我需要这个,因为我只希望看到这些文件的源 - code和不运行它们。
for a certain folder on my local Apache-Server (running with Ubuntu) I'd like that all *php-files will be displayed as if they were plain text-files. I need this since I only want to see the source-code of these files and NOT run them.
在寻找,我发现大多数人:-)有相反的问题,并不能真正找到一个解决方案给我。
While searching, I found that most people have the opposite problem :-) and couldn't really find a solution for me.
我需要在我的我的文件夹的.htacces文件,包括?
What would I need to include in the .htacces-file of my my folder?
谢谢!
推荐答案
答案是:
在.htaccess文件类型
in .htaccess-file type
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!)
感谢Brad!
这篇关于如何显示的PHP文件作为Apache中的纯文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文