The error occurs when you try to save settings or possibly when activating/deactivating plugins:
- Warning: fopen(./inc/settings.php): Failed to open stream: Permission denied in /path/to/mybb/admin/settings.php on line X.
- Warning: fwrite(): supplied argument is not a valid stream resource in /path/to/mybb/admin/settings.php on line X+1.
- Warning: fclose(): supplied argument is not a valid stream resource in /path/to/mybb/admin/settings.php on line X+2.
Solution: CHMOD the inc/settings.php file to 666 (in other words, make it so that the web server can write to inc/settings.php)