Title: error 500   Call to undefined function json_encode()
Last modified: August 31, 2016

---

# error 500 Call to undefined function json_encode()

 *  Resolved [lic-8008](https://wordpress.org/support/users/lic-8008/)
 * (@lic-8008)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/error-500-call-to-undefined-function-json_encode/)
 * Hello, today I saw the site was down with this message:
    The www…. page isn’t
   working www…. is currently unable to handle this request. error 500
 * After some checking and debugging I saw it was wordfence.
 * I renamed the folder on ftp (disabling WF), and everything was fine again.
 * Note: I can’t deactivate or edit anything via admin: the 500 error blocks me 
   from any action.
 * I tried to fresh install WF, error was back.
 * My only option is deleting the WF folder entirely via ftp.
 * in the html root ERROR LOG it says this:
    [20-Apr-2016 03:29:11 Europe/Rome] 
   PHP Fatal error: Call to undefined function json_decode() in /home/xxx/public_html/
   wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 
   1263
 * on line 1263 of the WAF.PHP it says this:
    / $jsonData = json_decode($this->response-
   >getBody(), true); /
 * I did not deactivate or activate any json myself.
    I’m on a standard shared hosting.
   Single site, standard wordpress installation.
 * As of now, the plugin is deactivated (folder renamed, so not seen by WordPress)
 * I have other sites where everything is working well.
 * What should I do (I’m no DB or PHP expert) to get WF up and running again?
    Right
   now the site is up and working because WF is not running.
 * Thank you for a great plugin!
    Linda
 * [https://wordpress.org/plugins/wordfence/](https://wordpress.org/plugins/wordfence/)

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

 *  [wfasa](https://wordpress.org/support/users/wfasa/)
 * (@wfasa)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/error-500-call-to-undefined-function-json_encode/#post-7298868)
 * Hello lic-8008,
    we recently had a similar post and the person who reported it
   said it was due to PHP json module not being present in his system. Since you
   can not access diagnostic pages and such while Wordfence is active, could you
   check with your host to make sure PHP json module is installed and active on 
   your system?
 *  Thread Starter [lic-8008](https://wordpress.org/support/users/lic-8008/)
 * (@lic-8008)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/error-500-call-to-undefined-function-json_encode/#post-7298882)
 * ok perfect and it worked.
    For others, what I did (suggested by wfasa: thank 
   you!)
 * 1 – checked with my provider if json was indeed active (it turned out it wasn’t)
 * 2 – in my provider’s cpanel -> options-> PHP I went to the ‘select PHP version’
   and settings, activated PHP 5.6 and activated the json module to load.
 * site is now up and running, WITH Wordfence ON and everyone is happy. It really
   just took 2 clicks once I knew what to do 🙂
 * NOTE: remember to activate wordfence again (admin, plugins), if you deactivated
   it through renaming the folder with ftp.
 *  Thread Starter [lic-8008](https://wordpress.org/support/users/lic-8008/)
 * (@lic-8008)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/error-500-call-to-undefined-function-json_encode/#post-7298883)
 * SOLVED, thank for such a quick and effective response. This is a basic plugin
   I really rely on 🙂
 *  [wfasa](https://wordpress.org/support/users/wfasa/)
 * (@wfasa)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/error-500-call-to-undefined-function-json_encode/#post-7298898)
 * Thanks for sharing your solution lic-8008,
    I will add that we have filed this
   issue as a bug (Case number: FB1669) which will be patched in a future version.
   At the minimum, you will then be receiving a more informative error message.
 *  [Nummi](https://wordpress.org/support/users/nummi/)
 * (@nummi)
 * [10 years ago](https://wordpress.org/support/topic/error-500-call-to-undefined-function-json_encode/#post-7299157)
 * Thank you wordfence. Really! I will never install your plugin again!!
    How can
   I log to my site?? It doesn’t work after I deactivated wordfence:
 * [http://martinkozar.sk/wp-admin/](http://martinkozar.sk/wp-admin/)
 * And there is no json module in my provider’s cpanel (my provider doesn’t even
   know this module exists).

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

The topic ‘error 500 Call to undefined function json_encode()’ is closed to new 
replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

## Tags

 * [error 500](https://wordpress.org/support/topic-tag/error-500/)
 * [json_decode](https://wordpress.org/support/topic-tag/json_decode/)

 * 5 replies
 * 3 participants
 * Last reply from: [Nummi](https://wordpress.org/support/users/nummi/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/error-500-call-to-undefined-function-json_encode/#post-7299157)
 * Status: resolved