Apply chmod to settings.php before changing it