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

  • Resolved summatix

    (@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 4 years, 6 months ago by summatix.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Gregory

    (@gioni)

    Hi!

    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

    (@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

    (@gioni)

    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.