Trying to install Drupal 7.14 on RHEL with Apache 2.4.2 and PHP 5.3.14, but keep getting the error:
PHP Fatal error: Call to undefined function json_encode().... includes/common.inc on line 4898

Running phpinfo from the command line and through http request provides different results. On the command line it works and I see that it is using json version 1.2.1. Running it through the browser does not show json as being enabled. The configure command parameters between the two appear to match up.

Any suggestions?

Comments

floydf’s picture

Don't know about RHEL, but on Ubuntu, there is a separate installation step using apt-get to install the json support for PHP. apt-get install php5-json, and then things work. Maybe same issue on RHEL?

Dan.Ashdown’s picture

Hi PhilipF,

json_encode() was removed from PHP core in 5.5 due to a licensing problem.

Are you sure you're not using 5.5?

As floydf mentioned you'll need to run the following commands on Ubuntu:

apt-get install php5-json
service apache2 restart

it should get back into core at some point soon though.

vb_swapnil’s picture

Hi Dan.Ashdown ,
Thanks for your help. Its working fine for me.