3

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>
Eric
  • 33
  • 6

1 Answers1

3

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
quanta
  • 51,413
  • 19
  • 159
  • 217
  • This seems to have worked. However, strangely, I can open some PHP files correctly, but not others. The ones I can't open are the ones I opened before I changed the options. Is there some sort of cache I need to clear? – Eric Mar 11 '13 at 03:46
  • Nevermind, I've decided not to use this method. However, this fixed the problem for the other files, so I'll mark it as the solution. – Eric Mar 12 '13 at 23:46