Closed Albvadi closed 5 months ago
Right, when DISALLOW_FILE_MODS
this doesn't need to be a red warning. We we just gray it out?
Because the "Enable Cache" button will be disabled regardless if DISALLOW_FILE_MODS
is set.
Right, when
DISALLOW_FILE_MODS
this doesn't need to be a red warning. We we just gray it out?
Yes and no... You can have DISALLOW_FILE_MODS
and at the same time (that was my case), have permissions problems in your server and the filesystem not be writeable too.
What I try to say it´s that are two totally different cases and should be treated that way.
For example, as I said, in my server I uploaded all files with my user and the server is running with apache user. I detected it becauses when I try to enable cache, It´s says the filesystem is not writable and I need a sysadmin to correcte the permissions.
And then, If I enable DISALLOW_FILE_MODS
I can't enable cache it either becauses in the test writable filesystem is checking if the constant is defined, but it´s not a problem with the writability of the system.
I need any way to enable cache with DISALLOW_FILE_MODS
, that's why I suggested adding a new constant that, when checking the system, can allow the cache to be activated even with DISALLOW_FILE_MODS
defined, such as WP_REDIS_SKIP_DISABLE_FILE_MODS
And, sorry for my language, it's difficult to explain well when it's not your native language.
Thanks for the details!
If DISALLOW_FILE_MODS
WordPress should not modify the filesystem and the only way to enable the object-cache.php
drop-in is using the wp redis enable
command. Or of course copying it by hand.
I think you're right. If DISALLOW_FILE_MODS
the warning should not be so aggressive.
Thank you for your explanation. One last question.
If
DISALLOW_FILE_MODS
WordPress should not modify the filesystem and the only way to enable theobject-cache.php
drop-in is using thewp redis enable
command. Or of course copying it by hand.
I believed that in order to activate the cache it was necessary to be able to write to the object-cache.php
file and by not allowing writing with DISALLOW_FILE_MODS
, it was not going to work.
So, can I activate the cache with the wp redis enable
command and/or copying the file by hand and even if it is DISALLOW_FILE_MODS
defined, will it still work? Because if that's the case and I can activate it from the console, for me it is the solution.
Thank you very much again.
Yep, that works!
Description
On my site I have the
DISALLOW_FILE_MODS
constant activated because I control file modifications through GIT. In this way, I am blocked from editing the theme files, installing / updating WordPress, plugins, themes, etc...The problem is that with this constant configured, in the latest version of the plugin the error appears indicating that the file system is not writable as checked in https://github.com/rhubarbgroup/redis-cache/blob/b582fbad902fd11d4d035ed62b1cec144b52081c/includes/class-plugin.php#L1352-L1376
I don´t consider that writing the object-cache.php file to manage the cache should be prohibited even if the rest of the modifications to WordPress files are.
Expected Behavior
Can enable Redis cache with
DISALLOW_FILE_MODS
Actual Behavior
Filesystem not writable error
Possible Fix
Not sure. Maybe create a new constant like
WP_REDIS_SKIP_DISABLE_FILE_MODS
or something like that. Or maybe use the actualWP_REDIS_DISABLE_DROPIN_CHECK
to skipDISALLOW_FILE_MODS
.Steps to Reproduce
DISALLOW_FILE_MODS
totrue
inwp-config.php
Additional context
Environment