Stuck with PHP 5.1.6 on RHEL or even CentOS (and a sysadmin who insists on using packages)? Need JSON? I did. The solution is easy:
yum install php-devel
pecl install json
The pecl install failed when it hit an 8MB memory limit, and I was clueless about how to fix it until I learned that the pecl installer ignores the php.ini. Turns out the best solution is to use the pear installer (which does follow php.ini settings):
pear install pecl/json
Posted May 28, 2008 by Casey Bisson
Categories: Technology. Tags: documentation, install, json, linux, php, red hat, rhel, system administration, yum.
9 Comments
Comments RSS
TrackBack Identifier URI
User contributed tags for this post:
php 5.1.6 json (377) - centos php json (300) - php 5.1 json (267) - json php 5.1 (217) - php json centos (203) - json php 5.1.6 (177) - php json rpm (163) - php-json rpm (151) - yum install json (146) - centos json (123) - yum install php json (121) - yum json (120) - json centos (114) - yum php json (112) - centos php-json (79) - php-json centos (78) - Enable Json in PHP (73) - php json 5.1.6 (71) - yum install php-json (70) - json php centos (64) - php-json-5.1.6 (61) - php json 5.1 (61) - PHP json yum (55) - centos 5 php json (52) - JSON rpm (51) - install json centos (48) - yum php-json (46) - redhat php json (45) - php 5.1.6 (44) - install json (44) - rhel php json (39) - json redhat (37) - centos json php (37) - json for php 5.1.6 (36) - php json rhel (35) - rhel json (34) - centos install json (34) - install json php (32) - redhat json (32) - json php rpm (32) - json yum (32) - pear install pecl/json (31) - php 5.1.6 json.so (31) - php json centos 5 (30) - json centos 5 (30) - php-json centos 5 (28) - centos install php json (28) - php-json rpm centos (28) - pear install json (27) - pecl install json (27) - php enable json (27) - centos 5 json (27) - yum json php (26) - pecl json centos (26) - centos pecl json (25) - php-pecl-json centos (25) - centos php json rpm (23) - json for php 5.1 (23) - centos php json_encode (23) - json php yum (22) - json RHEL5 (22) - php json rpm centos (21) - enable json php (21) - php json rhel5 (21) - PHP Version 5.1.6 json (20) - how to install json in php (20) - rhel5 php json (19) - php JSON Redhat (19) - install php json centos (19) - rhel 5 php json (19) - json rhel (18) - php-json yum (18) - php json install (18) - install json for php 5.1 on redhat 5 using yum repo (18) - php JSON (17) - install json php 5.1 (17) - json in php 5.1 (17) - yum install json php (17) - centos php 5.1.6 (17) - rpm php json (17) - centos php-pecl-json (17) - json in php 5.1.6 (16) - php install json (16) - red hat php json (16) - yum pecl (16) - json on php 5.1.6 (16) - php-json rhel5 (15) - 5.1.6 json (15) - php-json 5.1.6 (15) - centos php json yum (15) - rhel5 json (15) - json red hat (15) - centos 5 php-json (15) - php JSON yum install (15) - php-json-5.1.6 rpm (14) - install php json (14) - php centos json (14) - json php redhat (14) - redhat install json (14) - php-json centos rpm (14) - json_encode php 5.1.6 (14) - php-json redhat (13) - php json centos rpm (13) - json 5.1.6 (13) - install json php 5.1.6 (13) - json rpm centos (13) - centos php 5.1 json (12) - json php rhel (12) - rpm php-json (12) - php-json rhel (12) - PHP 5.1.6 JSON rpm (12) - centos php-json rpm (12) - php 5.1.6 json_encode (12) - Call to undefined function json_last_error() (12) - install (11) - php 5.1.6 install json (11) - install JSON centos 5 (11) - how to install JSON (11) - rhel 5 json (11) - php json_encode centos (11) - install json redhat (10) - json rhel 5 (10) - RHEL php (10) - pear json (10) - php-5.1.6 (10) - RHEL5 pecl (10) - install json php centos (10) - json_encode php 5.1 (10) - centos 6 (9) - json support PHP 5.1 (9) - php 5.1 install json (9) - pecl json install (9) - json install (9) - json php 5.1.2 (9) - php 5.1.2 json (9) - centos json install (9) - php 5.16 json (9) - json on php 5.1 (9) - json php 5.16 (9) - php-5.1.6 json (9) - json centos5 (9) - centos 5 json php (8) - rhel pecl (8) - php 5.1.4 json (8) - centos 4 php-json (8) - php json rpm 5.1.6 (8) - json php rhel5 (8) - yum install php-pecl-json (8) - php5 json centos (8) - json redhat 5 (8) -
I paul hereby apply to ur company i am a native of nigeria.i was born in_ 1980 in ondo
[...] json you will get an error about a 8MB limit the solution is to use pear – I found this thanks to this page [...]
[...] JSON on RHEL & PHP 5.1.6 [...]
Thanks man. This really helped.
I was migrating a CakePHP site to Rackspace’s Cloud server and ran into this issue. No repository had it so it was the pecl install for me. Worked like a charm.
I am having the trouble with JSON and PHP as well.
I have followed all the steps; running php -r ‘var_dump(function_exists(“json_encode”))’ return TRUE;
However as soon as I run this from a PHP script in apache; I get False;
Anyone care to help?
Thanks
Fatal error: Call to undefined function json_last_error()…
Any ideas?
i tried to install it using the pear command.but showing something like this bash: pear: command not found.plz help
@Andy
@hm2k
I faced these problems as well. There are a few steps required outlined in the writeup URL below. Basically, you need to add json.so to the list of extensions that PHP uses, and you need to restart your webserver.
http://slaptijack.com/system-administration/lets-install-json-for-php-5/