Adding JSON Support to PHP on your CentOS LAMP Installation

Before you begin start by making sure you have everything up to date by running
$--> yum update
or
$--> yum update "*php*"

The first command will update all components to the latest version.  Be careful make sure this won't interfere with anything else you may be running.

The second will update only php related components.  But caution should be taken with this command also if you are running any kind of bespoke application.  Make sure if you update your php components to the latest version/release that your web application will still operate correctly.

Next run
$--> pecl install json

After this command has completed you need to make sure that JSON support is enabled with your Apache/PHP stack starts

To do this, you can either add the following line to the end of  your /etc/php.ini file or what I prefer to do is create a json.ini in the folder /etc/php.d  so run the command
$--> echo “extension=json.so” > /etc/php.d/json.ini

To add this to your php.ini file instead the following command should do
$--> echo “extension=json.so” >> /etc/php.ini

Then restart your apache servcies
$--> service httpd restart

Comments

Popular posts from this blog

Basic Send Message to MQ with Java and IBM MQ JMS

Basic Receive Message to MQ with Java and IBM MQ JMS

Creating a simple Alert / Success Message with ASP.NET/VB using Bootstrap