
Some of the WordPress users who use Redis Object Cache plugin (by Till Krüss) on their websites could experience a “Filesystem: Disabled” error from this plugin (in previous versions – “Filesystem: Not writeable”). Most common cause of this is the use of DISALLOW_FILE_MODS constant in the WordPress configuration file and therefore some little adjustments must me made.


DISALLOW_FILE_MODS – Better leave it enabled
Many WordPress developers who use version control (e.g. GIT) for their websites certainly do not want any file modifications on a live version of their website. This is both – for security and data integrity, therefore it is logical that they have set this constant to “true” in the WordPress configuration file.
However changing DISALLOW_FILE_MODS constant to FALSE is not a correct solution to this problem. Leave it on if you use it, because there is another fix we can use – specially for Redis.

Fix for the problem with DISALLOW_FILE_MODS constant being on
Just place this code in your theme functions.php file or add it as a must-use plugin:
/*B:Allow file modifications for certain operations*/
add_filter( 'file_mod_allowed', 'dwp_allow_file_mod_for_certain_ops', 10, 2 );
function dwp_allow_file_mod_for_certain_ops( $allow_file_mod, $context ) {
if ( in_array($context, ['object_cache_dropin'])) {
return true;
} else {
return $allow_file_mod;
}
}
/*E:Allow file modifications for certain operations*/
And this should solve the issue with file system check.
Why Redis Object Cache do not work with the DISALLOW_FILE_MODS being on anymore?
Starting from the version 2.5.0 which was released at the end of 2023, the Redis Object Cache plugin “respects” the use of DISALLOW_FILE_MODS constant and therefore informs the WordPress admin that the file system is disabled or not writeable.
Read more about Redis
How to install and configure latest Redis version on AlmaLinux server