Support » Plugin: WP Cerber Security, Anti-spam & Malware Scan » Call to undefined function json_last_error()

  • Resolved summatix


    I’ve started seeing the following errors in my error logs:

    PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function json_last_error() in /wp-content/plugins/wp-cerber/cerber-lab.php:106
    Stack trace:
    #0 /wp-content/plugins/wp-cerber/cerber-lab.php(66): lab_send_request(Array)
    #1 /wp-content/plugins/wp-cerber/cerber-lab.php(385): lab_api_send_request()
    #2 /wp-includes/class-wp-hook.php(298): cerber_push_lab('')
    #3 /wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
    #4 /wp-includes/plugin.php(453): WP_Hook->do_action(Array)
    #5 /wp-includes/load.php(677): do_action('shutdown')
    #6 [internal function]: shutdown_action_hook()
    #7 {main}
      thrown in /wp-content/plugins/wp-cerber/cerber-lab.php on line 106

    I’m using WP Cerber 4.7.7. This has been causing some 500 errors for some requests.

    These errors started after enabling Cerber Lab connection -> Send malicious IP addresses to the Cerber Lab. Disabling this has resulted in the errors disappearing.

    • This topic was modified 5 years, 1 month ago by summatix.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Gregory



    That means your PHP version is out of date or your server has a bit strange PHP configuration with disabled (or not installed) JSON library. What version of PHP do you have on your website? You can check it here: Tools -> Show diagnostic information (link at the bootom).

    Thread Starter summatix


    PHP 7.0.18 running on CentOS 7. I installed the JSON library and the problem has resolved.

    I didn’t realize that json_last_error was a native PHP function (I assumed it was related specifically to WP Cerber because I’ve never seen it before). Due to licensing conflicts the JSON library isn’t installed by default for some distributions.

    Plugin Author Gregory


    Glad to hear that. Actually, I’ve never seen PHP on CentOS without JSON library. I’ve been using this distro for about nine years.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Call to undefined function json_last_error()’ is closed to new replies.