I spent most of today trying to set up a development mirror of some of our websites on my local PC so I could do development on something
other than a live site, and I'm starting to come to the conclusion that this is not how you're supposed to do this.
So, the theory of it all is that I can pull source files from our Git repository to my local computer, do any development work there, commit and push the changes, then run a local script to copy the modified files to the live server. Right now we use Git for source control, but all of the editing is still done on live servers directly. Any changes we make locally are automatically uploaded when saved.
I have Apache, PHP and MySQL all set up locally. I've modified the Windows hosts file to allow me to view those files in my browser as if I was visiting
http://dev.whatever. Using Apache's mod_substitute, I can even in place replace URLs to seamlessly point to dev.whatever URLs without having to modify anything directly in the source. Perfect.
However, trouble really starts when it comes to resolving PHP includes. See... the files were originally on a Linux server and I have a Windows workstation. They're all absolute paths (laziness related to how PHP resolves nested includes, mostly). I managed to do some really scary trickery with symbolic links to make /something/somewhere paths look like local paths on Windows, and that worked. But... only as long as PHP's include_path setting is being checked. That works for require / include, but not opendir, which I also need it to work for.
Ideally there would be some way to preprocess the PHP files before they're served to PHP's handler in Apache. That way I again wouldn't have to actually modify the files when serving them locally: I could just have something in my local virtual host to translate the paths before PHP saw them. Unfortunately, after searching for a while I'm all but certain this isn't possible with Apache.
This sucks. Right now I can only think of three ways around this:
1. My script for pulling the files down and syncing them can scan every last file for an absolute Linux path and replace it with a relevant absolute Windows path. The push script would do the opposite. The directories are very specific and predictable, so it's doable, but slow and annoying.
2. Switch to a Linux workstation.
3. Scrap the entire idea of doing this on my PC and set up separate dev sites on the server for every developer so we can actually
work independently with source control. This feels like it's defeating half of the purpose of Git.
I really don't want to do any of those.

It would be amazing if there was a simple way to do this directory path translation on the fly so I could use the unmodified source files on this computer.