changing file perms and checking app root env var