Allow symlinking paths.php

With the chdir done in paths.php, the actual location of paths.php is used. This PR does the chdir relative to public/index.php so that paths.php can be symlinked elsewhere in the filesystem.