WebDAV Incorrectly Opening PHP Files

apache-2.2webdav

I'm not sure if this is the right StackExchange site to ask this on, but I think it's the closest related to the topic.

I'm running a WebDAV server using Apache's mod_dav on Linux (Ubuntu). I've successfully connected to it with Windows 7. However, when I open the PHP files in an editor, I don't get their source code, but instead their output. Other files, including images, open correctly. Is there any way to fix this issue?

My Apache config:

<Location /webdav/>
        DAV On
        AuthType Digest
        AuthName "WebDAV"
        AuthDigestDomain /webdav/
        AuthDigestProvider file
        AuthUserFile /var/www/webdav/.htdigest
        Require valid-user
</Location>

Best Answer

Remove content type associations for PHP files:

RemoveType .php

If it doesn't work, remove handler:

RemoveHandler .php
ForceType text/plain

or disable PHP:

php_flag engine off
Related Topic