Re-added php backend after revert

Bleh. This was so many commits before I had to redo it. Oh well, here's the PHP without the bugs in gh-pages.