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.

What would I need to include in the .htacces-file of my my folder?



Duplicate of

Written by Brad

Accepted Answer


in .hatcces-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!)

Thanks to Brad!

Written by mdthh
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the community.
It is licensed under cc-wiki