I get Fatal error: Call to undefined function: json_decode() in /homepages/42/d187113575/htdocs/jdgillett/modules/lifestream/lifestream.module on line 92 every time I try to run this module. I tried looking at the code to see if there was something I could do to fix it. But I could not find json_decode() function anywhere else. Is there something that I am missing. I used http://(you).tumblr.com/api/read/json from the tumblr api in the settings. I would appreciate any help thanks.

Comments

skrillet’s picture

Assigned: skrillet » Unassigned
nickgs’s picture

Status: Active » Closed (won't fix)

Hi skrillet.

This is most likely because you are using an older version of PHP. I believe json_decode is supported in 5.2.x. If you are using any thing older you will have to write your own decoding routine OR use a third party library.

Thanks.

skrillet’s picture

Yeah it is php 4

jebernier’s picture

so, how do you remove if your server host won't install newer version of PHP?

John

nickgs’s picture

Hi John,

If this is the case you will need to use another json decoding routine to parse the tumblr data. Take a look at the link below. The first comment looks to have a solution, it looks like the routine will auto-detect if json_decode is available using if(!function_exsists('json_decode'))

http://us.php.net/manual/en/function.json-decode.php

Unfortunately this decoding of the JSON string is critical to make this work.

Thanks

Nick