Forum Moderators: phranque

Message Too Old, No Replies

Disabling PHP in Apache Virtual Servers

Apache returns script output not the source.

         

steve

9:15 am on Apr 30, 2008 (gmt 0)

10+ Year Member



I've set up WebDAV on an Apache2 with PHP4 as a replacement for FTP. I can create, edit, save html files etc. no problem at all.

When I try to open a php file, Apache runs the script and returns the output, I want it to return the source. I found several solutions on the web, but none work for me!

My code is as follows, I've commented out the four solutions I've tried so far:


<VirtualHost 192.168.123.145:80>
ServerAdmin *********
ServerName ***.***.***

DocumentRoot /var/www/html/***
Alias /site /var/www/html/***
Alias /webdav /var/www/html/***

<Location /webdav>
# php_flag engine off
# ForceType text/plain
# php_value engine off
# php_admin_flag engine off
DAV On
AuthType Basic
AuthName "WebDAV Restricted"
AuthUserFile /var/www/.DAVlogin
<LimitExcept GET OPTIONS>
Require valid-user
</LimitExcept>
</Location>
</virtualhost>

The idea is that url/site runs the script, and url/webdav returns the page source.

Is there anything else I can try? I'm pulling my hair out, any help will be much appreciated!

/Steve

steve

2:36 pm on Apr 30, 2008 (gmt 0)

10+ Year Member



Out of desperation I deleted index.php and created a new one and uncommented ForceType text/plain in <virtualhost> now its working!

TheMadScientist

4:08 pm on May 8, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You could probably also use the following in the .htaccess of the site you wish to cancel processing on:

RewriteEngine on
RewriteRule .? [T=text/plain,L]