diff --git a/php/generate-html.php b/php/generate-html.php
index d6bfb73..7df70db 100644
--- a/php/generate-html.php
+++ b/php/generate-html.php
@@ -26,7 +26,9 @@
// This works? Yes, yes it does.
// We do this to isolate the environment and include-once triggers,
// otherwise we could include the documents in an ob_* wrapper.
- $document = `php $phppath`; // should be identical to shell_exec("php $phppath")
+
+ // Same as shell_exec, except we don't have to escape quotes.
+ $document = `cd "$TEMPLATES_ROOT"; php $phppath`;
file_put_contents($docpath, $document);
}