安装/配置
在线手册:中文 英文
PHP手册

安装

As of PHP 5.2.0, the JSON extension is bundled and compiled into PHP by default.

安装此 PECL 扩展相关的信息可在手册中标题为 PECL 扩展的安装 章节中找到。另外的信息,如新的发行版本、下载、源文件、 Additional information such as new releases,维护人员信息及变更日志等,都在此处: » http://pecl.php.net/package/json


安装/配置
在线手册:中文 英文
PHP手册
PHP手册 - N: 安装

用户评论:

haebler at gmail dot com (22-Jan-2011 05:45)

On RHEL5/CentOS5 add the EPEL repository (http://fedoraproject.org/wiki/EPEL).

After that, installation is as simple as:

    sudo yum install php-pecl-json

cko at audaxis dot com (19-Oct-2010 02:11)

On gentoo, need the USE flag "json" to compile into php

dmitryzayats at NOSPAM dot yahoo dot com (20-Nov-2009 05:06)

Installation steps on CentOs 5.3 include

# yum install php-devel
# yum install php-pear
# yum install gcc
# pear install pecl/json

# cd /etc/php.d
# echo "extension=json.so" > json.ini
# service httpd restart

After that phpinfo() would output

json support     enabled
json version     1.2.1

dave at davidhbrown dot us (20-Jan-2009 12:24)

On one server I use (FreeBSD 6.3; PHP 5.2.6 as module in Apache 2.2.10), PHP was compiled with the '--disable-all' configuration option. Consequently, there exists a secondary configuration file -- /usr/local/php5/etc/extensions.ini -- in which the line

; extension=json.so

must be uncommented (delete the semicolon) and Apache restarted for these functions to be available.