@charlie this code snippet should be added above the
/* That's all, stop editing! Happy blogging. */ comment that is natively present.
If it isn’t then it has probably been removed by the hosting provider
In that case, I’d recommend you put it as first line to be sure you don’t add anything after the
settings.php file inclusion of the config file.
Anyway, if you still keep getting problems, you should ask your hosting provider why you get an error after changing the file. Maybe they have some kind of security check in place.
Keep me posted on this, I’m really interested in what the issue ends up being.