Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #32390
    Chin Chew
    Guest

    Hi,
    Have a “Fatal error” message when loading my website – current php version 7.0.
    Updated w3-total-cache to latest update two days ago. Then website have issue of loading a “black” page when clicking on home page.
    Checked with Hostgator on the “black” page problem. As website ran on an old version of php, Hostgator helped to update php to V7.0.
    Then I get this “Fatal Error” message:
    Fatal error: Uncaught Error: Call to undefined function W3TC\json_decode() in /home4//public_html/[redacted]/wp-content/plugins/w3-total-cache/Config.php:61 Stack trace: #0 /home4//public_html/[redacted]/wp-content/plugins/w3-total-cache/Config.php(34): W3TC\Config::_util_array_from_storage(0, false) #1 /home4//public_html/[redacted]/wp-content/plugins/w3-total-cache/Config.php(455): W3TC\Config::util_array_from_storage(0, false) #2 /home4//public_html/[redacted]/wp-content/plugins/w3-total-cache/Config.php(127): W3TC\Config->load() #3 /home4//public_html/[redacted]/wp-content/plugins/w3-total-cache/Dispatcher.php(16): W3TC\Config->__construct() #4 /home4//public_html/[redacted]/wp-content/plugins/w3-total-cache/Dispatcher.php(26): W3TC\Dispatcher::component(‘Config’) #5 /home4//public_html/[redacted]/wp-content/plugins/w3-total-cache/Mobile_Redirect.php(16): W3TC\Dispatcher::config() #6 /home4//public_html/[redacted]/wp-content/plugins/w3-tot in /home4//public_html/[redacted]/wp-content/plugins/w3-total-cache/Config.php on line 61
    Hope you can help to resolve this.
    Look forward to your urgent reply.
    Thank you.
    Chin

    #32438
    Jesse Owens
    Keymaster

    Hi Chin-

    It’s pretty strange to be getting the error Undefined Function for json_decode(), most PHP installations have that enabled by default.

    First, make sure JSON support is enabled in your PHP settings. You can do that by creating a new file in your website’s document root named phpinfo.php . Then, add the following line to the file:
    <?php phpinfo(); ?>

    Once you have a phpinfo file, visit that file in your browser by going to example.com/phpinfo.php and look for the line json support. It should say “enabled.” Check out HostGator’s documentation for more info on how to create a phpinfo file.

    Once you’ve made sure that JSON support is enabled, there’s a couple more things you can check. First, check your wp-config.php file for the following line:
    define( 'W3TC_CONFIG_DATABASE', true );

    If that’s there, you might want to consider removing it and storing your config in a file. It is often faster on a shared server to access the configs from disk rather than from the database, and it might contribute to this error.

    Finally, if that’s not there, it’s possible that your wp-content/w3tc-config/master.php file has become corrupted. Delete that file, then navigate to the Performance > General Settings and click Save all settings and purge caches to recreate your config.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Fatal error: Call to undefined function W3TC json_decode()’ is closed to new replies.