Search

Hello peeps,

Any idea what would cause a json_encode error on a symphony upload to a compatible server?

PHP Fatal error:  Call to undefined function json_encode() in /export/sites/htdocs/test/website/symphony/lib/toolkit/class.administrationpage.php on line 224, referer: http://test.domain.co.uk/website/symphony/

I can access the admin login page, but when it re-directs to logged in.. I get a error 500 and server admins gave me this error info.

It looks like you don't have the PHP JSON extension enabled on your server. Perhaps it should be added as server requirement for Symphony...

Yes I believe it should. Is it extension specific or core?

JSON functions are invoked throughout the core to fetch translations of JavaScript strings and provide some basic Symphony environment variables (that's the case for line 224 of class.administrationpage.php), so I'd say it's core. Perhaps nickdunn or brendo can tell you more about that.

Ahh ok thanks, Installing on a clients server and gave them the Symphony spec from the landing page. So they have confrimed the minimum requirements.. and this has creeped up.. Front of site is working great, but no access to backend.. just see the above error.. so in all honesty, It feels like a requirement for a core install but yet is PHP JSON usually switched on module on most installs/php apache setups?

Well... I can't tell for the majority of hosting providers, but DreamHost supports it. As far as I know, newer versions of PHP have JSON enabled by default (see here), so it seems pretty rare not to have it available. I can't be more precise than this, sorry!

It's cool, thanks for your info... it'll help justify my case for getting what I want and pave the way for more Symphony projects with them :)

I've posted a new issue on GitHub about JSON and server requirements.

Ok cool, it does make sense to mention it, so fingers crossed. Thanks again for clarifying what the issue is likely to be, very much appreciated.

As discussed on the issue tracker, the host is deliberating trying to be difficult.

From php.net.

There is no installation needed to use these functions; they are part of the PHP core.

As the comment on the same page says:

If you're not seeing the json functions on 5.2.0 or newer, make sure php wasn't compiled with --disable-json

Ahhh, now that's probably the case based on what your saying here.. they had to re-install the server last week cos they said --with-xsl was

enabled but it wasn't.

Thanks again.

Edit... client IT refuses to switch on Php json ... happy days :(

Perhaps the question to ask is why they have disabled it in the first place? It's on by default in the PHP download, so they have had to explicitly compile PHP and turn it off to disable JSON.

Maybe it's just a case of they recompiled it last week so they can't be bothered doing it again so soon. Good luck, sounds like a fun client..

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details