Home > centOS, Fedora 12, PHP > Centos – php json fail

Centos – php json fail

* Installed centos 5.4, and default php, but programs useing json_encode/decode is not working as expected
* Problem is php does not shifted with json, so it need to be installed.

1. yum install pecl

2. json extension need to add


[root@www html]# pecl install json

...

Build process completed successfully
Installing '/var/tmp/pear-build-root/install-json-1.2.1//usr/lib64/php/modules/json.so'
install ok: channel://pear.php.net/json-1.2.1

3. cd /etc/php.d/


[root@www php.d]# echo "extension=json.so" >> json.ini
[root@www php.d]# ls
dbase.ini  imap.ini  json.ini  mbstring.ini  mcrypt.ini  mysqli.ini  mysql.ini  pdo.ini  pdo_mysql.ini  pdo_sqlite.ini
[root@www php.d]# cat json.ini
extension=json.so
[root@www php.d]#

4. Restart apache


[root@www php.d]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

Done, now json is available.

Advertisements
Categories: centOS, Fedora 12, PHP
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: