500 Error - Call to Undefined function json_encode()


Active member
Started to get a HTTP500 error on my forum today, can't access the forum at all. Lots of these errors below in apache log. Any ideas on how to sort?

[error] [client] PHP Fatal error: Call to undefined function json_encode() in /var/www/vhosts/mydomain.com/httpdocs/forum/library/XenForo/ViewRenderer/Json.php on line 179
TIA :)

Chris D

XenForo developer
Staff member
Can you access the admin CP?

First of all, disable ALL add ons.

Then enable them all one by one. I'd expect it to be one of those that's causing the problem.

Jake Bunce

XenForo moderator
Staff member
That function is built-in to PHP. If it's missing then you need to look at your PHP configuration.


Contact your host or server person. If you manage your own server then make sure PHP wasn't compiled with --disable-json. And make sure json_encode isn't in the disable_functions list in your PHP settings.