• Resolved Knut Sparhell

    (@knutsp)


    PHP Fatal error: Uncaught Error: Call to a member function get() on null in /wp-content/object-cache.php:2883
    Stack trace:0 /wp-includes/option.php(618): wp_cache_get('alloptions', 'options', false)

    1 /wp-includes/option.php(164): wp_load_alloptions()
    2 /wp-includes/functions.php(7626): get_option('blog_charset')
    3 /wp-includes/formatting.php(1137): is_utf8_charset()
    4 /wp-includes/formatting.php(4681): wp_check_invalid_utf8('Apache')
    5 /wp-content/object-cache.php(677): esc_html('Apache')
    6 /wp-content/object-cache.php(711): WP_Object_Cache->error_log('open_connection…', Object(SQLite3Exception))
    7 /wp-content/object-cache.php(552): WP_Object_Cache->open_connection()
    8 /wp-content/object-cache.php(2744): WP_Object_Cache->__construct()
    9 /wp-includes/load.php(897): wp_cache_init()
    10 /wp-settings.php(151): wp_start_object_cache()
    11 /wp-config.php(125): require_once('…')
    12 /wp-load.php(50): require_once('…')
    13 /wp-blog-header.php(13): require_once('…')
    14 /index.php(17): require('…')
    15 {main}

    WordPress 7.0, PHP 8.4.23

    The log was flooded with the above (redacted) several times per second, maing it 100 kB in just an hour. I deleted the cache db files to get the site back up. After this happened several times in a row for the next hours, I had to deactivate it by renaming the plugin folder.

    It seems it started happening some after the host upgraded PHP. Auto loaded options is a bit high (10 MB). No activity/editing was going on in admin. Classic theme. No obscure plugins. Nothing special.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author OllieJones

    (@olliejones)

    Something went wrong very early in the WordPress life cycle.

    Please ensure that the sqlite3 extension is enabled in your new php version. For best results also enable the igbinary and apcu extensions.

    You can remove the cache by

    1. deleting the …/wp-content/object-cache.php file
    2. deleting the …/wp-content/plugins/sqlite-object-cache/ directory,

    I hope this helps sort out your problem.

    Plugin Author OllieJones

    (@olliejones)

    In technical lingo. This plugin, really early in php’s lifecycle, creates a WP_Cache object. If the constructor of that object fails, it causes the traceback you showed. It returned a null item, not the created object. php doesn’t let us call (null)->get(), which is what happens if the constructor fails.

    But if it fails that early in the WordPress life-cycle, it is hard to recover gracefully. I’ll try to make it more graceful. But my logic for sanity-checking php for compatibility resides in the plugin-activation code.

    This problem smells to me you migrated TO a newer php version that does not have the needed php extensions activated, FROM a php version that does. I’ve never tried that particular sequence.

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

You must be logged in to reply to this topic.