 <p>What happens if you change $URLPath from</p> <pre><code>$URLPath = "http://localhost/~matthew/"; </code></pre> <p>to </p> <pre><code>$URLPath = $_SERVER['DOCUMENT_ROOT'] . "/~matthew/"; </code></pre>