Fatal error enabling Object Cache (Redis) – undefined function
-
Hi,
I am experiencing a fatal error when trying to enable Object Cache (Redis) in the LiteSpeed Cache plugin on multiple WordPress sites.
Environment:
- WordPress 6.9.4
- LiteSpeed Cache plugin 7.8.1
- PHP 8.3 / 8.4 / 8.5.5 (same result on all)
- Web server: LiteSpeed (managed by hosting.com)
- Redis: enabled from cPanel, Status = Running, Host = 127.0.0.1, Port = 42527, Password enabled, 16 databases
Steps:
1) Removed all old caching plugins (A2 Optimized etc.), including their advanced-cache.php and object-cache.php files.
2) Removed any wp-content/object-cache.php drop-in from all sites.
3) Fresh install of LiteSpeed Cache plugin.
4) Configured Object Cache as:- Object Cache: ON
- Method: Redis
- Host: 127.0.0.1
- Port: 42527
- Password: from cPanel Redis
- Redis DB ID: 0 or 1
Issue:
- The connection test shows “Connection test: Failed”.
- When saving Object Cache settings, WordPress goes into critical error with this message (identical on several sites):
Uncaught Error: Call to undefined function LiteSpeed\litespeed_oc_disable_ext_cache()
in wp-content/plugins/litespeed-cache/src/object-cache.cls.php:586Stack trace:
LiteSpeed\Object_Cache->_connect()
LiteSpeed\Object_Cache->_reconnect()
LiteSpeed\Object_Cache->update_file()
LiteSpeed\Activation->update_files()
LiteSpeed\Conf->update_confs()
LiteSpeed\Admin_Settings->save()
LiteSpeed\Admin->_proceed_admin_action()
…In wp-admin I also had:
“Can NOT find LSCWP path for object cache initialization in wp-content/object-cache.php”After deleting wp-content/object-cache.php this message disappeared, but the fatal error on litespeed_oc_disable_ext_cache() persists when trying to enable Redis Object Cache.
Questions:
- Is this a known issue in LSCache 7.8.x with PHP 8.3 / 8.4 / 8.5?
- Is there a recommended workaround (e.g. specific LSCache version, configuration or PHP version) to avoid this “undefined function litespeed_oc_disable_ext_cache()” error when enabling Object Cache?
- Should the object-cache.php drop-in be created/managed differently in this case?
For now, I have disabled Object Cache and I am only using page cache, which works fine. Any guidance on how to use Redis Object Cache safely in this environment would be appreciated.
Thanks.
The page I need help with: [log in to see the link]
You must be logged in to reply to this topic.