• 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:586

    Stack 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]

Viewing 1 replies (of 1 total)
  • This looks like two separate checks, not only a Redis credential problem.

    1. The failed Redis connection test should be isolated first:
    • confirm the exact Redis host/port/password from the hosting panel
    • if the host provides a Redis CLI/test tool, test the same host/port/password outside WordPress
    • confirm whether Redis is available to PHP on the same account/container, not just enabled in cPanel
    1. The fatal error is a different signal. An “undefined function” inside the LiteSpeed object-cache save path usually points to a stale/partial plugin/drop-in/bootstrap state, not normal Redis failure.

    I would test this sequence on one affected site only:

    • leave Object Cache OFF
    • delete wp-content/object-cache.php
    • delete wp-content/advanced-cache.php only if you know it belongs to the previous cache setup
    • fully remove the LiteSpeed Cache plugin folder, not just deactivate/reactivate
    • reinstall a clean copy of LiteSpeed Cache
    • restart/flush PHP OPcache if the host exposes that option
    • test on PHP 8.3 first, not 8.4/8.5
    • then enable Object Cache again

    If the same fatal error appears after a clean plugin reinstall + no old drop-in + OPcache flush, then it is likely a LiteSpeed Cache 7.8.x bug or host-specific bootstrap bug and worth reporting with the exact plugin version, PHP version, and stack trace.

    For now, keeping Object Cache disabled and using page cache only is the right safe state.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.