• Resolved matteo raggi

    (@whichtransfers)


    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 5 replies - 1 through 5 (of 5 total)
  • Plugin Support litetim

    (@litetim)

    @whichtransfers do you have the latest LSC version installed? I know there were issues with OC in 7.8 but was fixed later.
    And make sure the object-cache.php from wp-content has the correct content(maybe delete it).

    Same issue. As this user already noted, we are also on 7.8.1.

    Plugin Support litetim

    (@litetim)

    @whichtransfers and @fooey Are you able to edit any settings from LSC => Cache?
    What is the state of your site/admin? is it accessible?

    It wasn’t accessible before I deleted the object-cache.php, but it is now. I can edit settings. I just disabled object cache for now until this is resolved. It does make a difference in site speed, though, so it would be nice to figure this out. Also, worth noting, we manage several sites, and not all of them experienced this issue and are still connected so it’s not across the board. Thanks!

    Plugin Support litetim

    (@litetim)

    @whichtransfers and @fooey we have a dev build that has a patch for this issue.
    DISCLAIMER: this is a unstable, incomplete, work in progress build. If you try it, we do not encourage you to leave it on LIVE. For example, at this moment VPI, UCSS, CCSS is not working.

    You can test this build by going to LSC => Toolbox => Beta Test
    Click on dev then on Update

    Please tell us if this fixes the error issue.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.