Last modified: 2013-06-04 19:57:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T51114, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 49114 - PHP Fatal error: Call to undefined function json_encode() in includes/json/FormatJson.php on line 130
PHP Fatal error: Call to undefined function json_encode() in includes/json/F...
Status: RESOLVED DUPLICATE of bug 49122
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.22.0
All All
: Unprioritized critical (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-04 12:36 UTC by Dan Jacobson
Modified: 2013-06-04 19:57 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Dan Jacobson 2013-06-04 12:36:18 UTC
PHP Fatal error:  Call to undefined function json_encode() in /home/jidanni/mediawiki/includes/json/FormatJson.php on line 130

The whole wiki breaks.
Comment 1 Dan Jacobson 2013-06-04 12:41:55 UTC
Use of undefined constant JSON_UNESCAPED_SLASHES - assumed 'JSON_UNESCAPED_SLASHES'
Use of undefined constant JSON_UNESCAPED_UNICODE - assumed 'JSON_UNESCAPED_UNICODE'
Use of undefined constant JSON_HEX_TAG - assumed 'JSON_HEX_TAG' in /home/jidanni/me
Use of undefined constant JSON_HEX_AMP - assumed 'JSON_HEX_AMP' in /home/jidanni/me

seen in git as of
$ date -u
Tue Jun  4 12:41:24 UTC 2013
Comment 2 Sam Reed (reedy) 2013-06-04 13:02:46 UTC
What version of PHP?
Comment 3 Dan Jacobson 2013-06-04 13:21:25 UTC
$ dpkg -l \*php*|grep ^ii
ii  libapache2-mod-php5   5.5.0~rc2+dfsg- i386            server-side, HTML-embedded scripting language (A
ii  php-doc               20100521-2      all             Documentation for PHP5
ii  php-elisp             1.5.0-1.1       all             Emacs support for php files
ii  php-gettext           1.0.11-1        all             read gettext MO files directly, without requirin
ii  php5                  5.5.0~rc2+dfsg- all             server-side, HTML-embedded scripting language (m
ii  php5-cgi              5.5.0~rc2+dfsg- i386            server-side, HTML-embedded scripting language (C
ii  php5-cli              5.5.0~rc2+dfsg- i386            command-line interpreter for the php5 scripting 
ii  php5-common           5.5.0~rc2+dfsg- i386            Common files for packages built from the php5 so
ii  php5-mcrypt           5.5.0~rc2+dfsg- i386            MCrypt module for php5
ii  php5-mysql            5.5.0~rc2+dfsg- i386            MySQL module for php5
ii  phpmyadmin            4:4.0.1-2       all             MySQL web administration tool
Comment 4 Sam Reed (reedy) 2013-06-04 13:34:53 UTC
json_encode has been around for a while, and we use it in the code paths for older PHP, just with some different options set where they are available.

It would sound like your current version is missing the json support for some reason or another.

As you're running PHP 5.5 rc2, I'd contact whoever is your upstream package provider and tell them of the issue. I can't really believe this is MediaWiki at fault, and as 5.5 rc2 came out a couple of weeks ago...
Comment 5 Dan Jacobson 2013-06-04 13:37:22 UTC
Oops...
php5 (5.5.0~rc1+dfsg-1) experimental; urgency=low

  * Starting from this version, the JSON module is no longer compiled in
    due to licensing problems, and you need to install the JSON extension
    as external php5-json package that is using json-c library.

 -- Ondřej Surý <ondrej@debian.org>  Fri, 17 May 2013 14:43:04 +0200
Comment 6 Antoine "hashar" Musso (WMF) 2013-06-04 13:47:13 UTC
And the Debian bug is http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=692613 :

 % rgrep 'The Software shall be used for Good, not Evil.' .
 ./README.REDIST.BINS:The Software shall be used for Good, not Evil.
 ./ext/json/utf8_to_utf16.c:The Software shall be used for Good, not Evil.
 ./ext/json/utf8_decode.c:The Software shall be used for Good, not Evil.
 ./ext/json/JSON_parser.c:The Software shall be used for Good, not Evil.


:-D
Comment 7 Krinkle 2013-06-04 13:55:11 UTC
See bug 49122.
Comment 8 Alex Monk 2013-06-04 19:57:16 UTC

*** This bug has been marked as a duplicate of bug 49122 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links