Linux
1. CentOS
php installation package path:/data/php5.6.14/PHP installation path:/usr/local/php/
Find the directory of json in PHP installation package.
cd /data/php5.6.14/ext/json/
Execute phpize
/usr/local/php/bin/phpize
Compile and install
./configure --with-php-config=/usr/local/php/bin/php-config make && make install

Now json.so in the directory of /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
Add the code below to php.ini
extension=json.so
Restart PHP and check whether PHP-curl is installed using phpinfo()
2. Ubuntu
Use the command below to install
sudo apt-get install php5-json
Restart it.