$install_dir = array_pop($cur_dir); line. Issue was happening because nginx doesn't add a trailing slash to DOCUMENT_ROOT. Simple change to nginx configuration adds that so no need to edit the code here. Fixed conflict with AUTHORS.md