Here’s a way to add JSON support for PHP on your CentOS server.

yum install php-pear php-devel gcc make
pecl install json
cd /etc/php.d
echo "" >> json.ini
service httpd restart

After these, you can easily check if it has been installed correctly. Either check your phpinfo() page or execute the following command.


php -i | grep -i json

json support => enabled
json version => 1.2.1

About The Author

This site uses Akismet to reduce spam. Learn how your comment data is processed.