I have a fundamental question: who is the owner of Localsettings.php and who is (or should be) the group for Localsettings.php? I assume both owner and group have to "rw" right to Localsettings.php.
LocalSettings.php should probably belong to your Web user and group, as presumably would all of the files for your Web site. I would recommend that you CHMOD LocalSettings.php to 600 unless your setup requires otherwise.