I'm getting PHP output rather than the source
This is caused by the simple fact that a GET is always going to run the script. There is no way to distinguish a "GET for the result" and a "GET for authoring."
Note: this problem applies to any server-side scripting solution. It is not specific to PHP. For demonstrations sake, I will use PHP as an example.
PHP and mod_dav will also conflict when they each attempt to handle the different HTTP request methods. This is caused by the simple fact that both modules are configured for the same location or directory, and are competing for acting as the content handler.
There are several ways to fix this. They all solve the problem by providing a separate URL to access the PHP source. In one scenario, you can provide a simple "source" URL:
[color=#0000CC]Alias /phparea /home/gstein/php_files
Alias /php-source /home/gstein/php_files
A different alternative is to present the source through another virtual server:
There are probably a few, similar ways to accomplish the same kind of setup. I have used the first form (a secondary URL space) successfully, but have not tried the second virtual host. Other people have reported success with it, however.
In each of these ways to fix the problem, we are taking advantage of the fact that there are different URL namespaces that map to the same, underlying filesystem space. By attaching different processing to the URL spaces, we can create different behaviors during the translation to the filesystem space.
Finally, I believe that it may be possible to ensure that mod_dav occurs later in the AddModule directives, thus making mod_dav be the content handler for methods besides GET. If PHP is later in the list, then it will end up handling all methods. This trickery does not solve the authoring problem, however.