Welcome, Guest
Username: Password: Remember me

TOPIC: Undefined function json_decode

Undefined function json_decode 2 years 1 week ago #78582

  • omar
  • omar's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
I just downloaded version 2 went through the install steps; at the end of the installation I clicked on the 'Administration' button and got a blank page.

I have PHP 5.1.6 and MySQL 5.0.77 and the mbstring extension.

Found this in the web server error log:
PHP Fatal error: Call to undefined function json_decode() in .../limesurvey/application/helpers/common_helper.php on line 5425

Any help with fixing this would be appreciated. Thanks.
The administrator has disabled public write access.

Re: Undefined function json_decode 2 years 1 week ago #78589

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5875
  • Thank you received: 722
  • Karma: 223
Yep,

json_decose : PHP 5 >= 5.2.0
php.net/manual/fr/function.json-decode.php
Last Edit: 2 years 1 week ago by DenisChenu.
The administrator has disabled public write access.

Re: Undefined function json_decode 2 years 1 week ago #78623

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
I think Limesurvey 2 requires PHP 5.2 or 5.3. Please update your PHP version.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Undefined function json_decode 1 year 4 months ago #89131

  • marcus
  • marcus's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
This information about a later version of PHP was very useful. But I wasted a lot of time wondering what was wrong, since the official Release Notes
www.limesurvey.org/en/stable-release
clearly say that LimeSurvey 200+ requires "PHP 5.1.6 or higher".

So much for RTFM, when the FM is more F than M.
Last Edit: 1 year 4 months ago by marcus.
The administrator has disabled public write access.

Re: Undefined function json_decode 1 year 4 months ago #89138

  • mdekker
  • mdekker's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 340
  • Thank you received: 68
  • Karma: 38
Our manual is a wiki and the project is run by volunteers so instead of complaining, you could get over to the wiki to add that information.

Thank you in advance.
---
Menno Dekker
The administrator has disabled public write access.
The following user(s) said Thank You: DenisChenu

Re: Undefined function json_decode 1 year 4 months ago #89203

  • marcus
  • marcus's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
I was being snarky, but I was clearly talking about the Release Notes, not the wiki. You seem not to have addressed that at all - unless the official Release Notes are sourced from the wiki, which seems odd; how would general help-y people in the community know what version of PHP the app was coded against? Isn't that for the developers to say? Am I supposed to go edit the wiki with a note that says, "Ignore the Release Notes, the necessary PHP version appears to be something higher than specified, but I'm not sure which?"

When we users go to download code to install or upgrade LimeSurvey, the most important thing is the Release Notes, which are specifically called to our attention on the "Download" page and displayed clearly on the "Latest stable release" page. Here's a screenshot:

stable-release-snap.png


I took this explicit information in good faith and did follow the upgrade process detailed in the wiki. Eventually, after becoming thoroughly frustrated, I managed to get errors displayed and finally got to this page, where I find someone with the same problem and someone, apparently on the team, saying they "think" a later version is required. This may explain why the Release Notes are not right, since people on the team may not be sure themselves. This is scary.

The Release Notes for any project are necessary, fundamental documentation, presumably compiled by the project's core team. In this case, they appear to have been the direct cause of a failed upgrade. This is really not ok. I'm sorry if my saying so offends the sensitive but, while someone in my situation can always be more diplomatic (especially me, let's face it), actually distributing software with instructions that might see the software fail to run at all is pretty bad. If it were my project, I'd expect people to be pretty annoyed, and to see the project in a somewhat less favourable light.

Anyways, enough of this. Maybe I just suck and should be locked in a room with no network access, rocking backwards and forwards, wearing a jacket with inexplicably long sleeves, unable to be helped by confused psychologists who, sadly, might have been able to decipher my mumblings if only they'd done some programming training.

But it would be kind of nice, for other, less annoying hapless upgraders, assuming the PHP version issue is actually the issue, to actually find out which version of PHP this app should run on. Even a developer saying something like "well, the one on my dev box is PHP blah.blah, so that should work" would help. But I concur that I may have exhausted my ration of tolerance and will be left to suck it and see. I return now to the succour of darkness.
The administrator has disabled public write access.

Re: Undefined function json_decode 1 year 4 months ago #89207

  • c_schmitz
  • c_schmitz's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 719
  • Thank you received: 91
  • Karma: 83
First let me say that we are sorry for the inconvenience.

Well, in general the release notes and requirements are right. You can have json_encode, json_decode with version older than 5.2, too. You will just have to have the json PECL library installed on your system. (see pecl.php.net/package/json).

Unfortunately until now nobody thought of adding this to the installer requirement check yet - but it will be added in the next version.
Support us, too. Donate to the LimeSurvey project and help keep us going!
The administrator has disabled public write access.

Re: Undefined function json_decode 1 year 4 months ago #89215

  • c_schmitz
  • c_schmitz's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 719
  • Thank you received: 91
  • Karma: 83
Marcus, one more thing though. The note from Mazi is seven months old - LimeSurvey 2.0 was not released yet at the time - so Mazi did a wild guess there. Anyway, no reason to get so upset about this.
Support us, too. Donate to the LimeSurvey project and help keep us going!
Last Edit: 1 year 4 months ago by c_schmitz.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.130 seconds
Donation Image