Drupal 8: Installation, fixing permissions

So it turns out that my own stupidity (or smart arse idea!) caught me out. I install drupal core in a separate directory out of the web root (docroot!) directory and symlink back to it. My web root looks a little like this:


lrwxrwxrwx autoload.php -> /var/www/src/drupal-8.x/autoload.php
lrwxrwxrwx core -> /var/www/src/drupal-8.x/core
-rw-r--r-- .htaccess
lrwxrwxrwx index.php -> /var/www/src/drupal-8.x/index.php
drwxr-xr-x modules
drwxr-xr-x profiles
-rw-r--r-- robots.txt
drwxr-xr-x sites
drwxr-xr-x themes

This stops core hacking and makes updates to core easy as pie. But it turns out this causes problems with Drupal 8. The installer uses a simple 'chdir(..)' as the very first argument. Which happens to move the current working directory from core down to what the installer thinks is the web root. But of course it's not, it's the symlinked location. Ironically the only way to fix this is to temporarily hack core (or stop using my shitty way of symlinking).