Page 1 of 1

Call to undefined function json_encode()

PostPosted: Fri Nov 19, 2010 1:24 pm
by dha
Hi Steve,

I have the app working on my PC but when I deployed it onto the lamp server, I got this error log message:
[error] [client x.x.x.15] PHP Fatal error: Call to undefined function json_encode() in /home/alst/public_html/dataface/Dataface/Record.php on line 2674, referer: http://alst.mysite.com/alst_app/index.p ... cursor=0...

Could you help by pointing out what I missed? Truly appreciated.

Don

Re: Call to undefined function json_encode()

PostPosted: Fri Nov 19, 2010 3:01 pm
by goxatago
Perhaps the json lib is not installed ?

Try this
http://slaptijack.com/system-administra ... for-php-5/

Re: Call to undefined function json_encode()

PostPosted: Mon Nov 22, 2010 11:06 am
by shannah
Yes. Apparently json is only available with PHP 5.2 or higher. I'll be adding workarounds for this in the next version. To work around this you basically just need to define the json_encode and json_decode functions. Xataface is distributed with a PEAR class Services_JSON which implements these as methods... they just need to be wrapped in functions named json_encode and json_decode