Install json for PHP 5

  1. Install json – This was actually trickier than expected. I assumed I would be able to install this via pear. Apparently, a PEAR Services_JSON package was developed, but it has never been accepted into the official repository. The trick instead is to use the PECL json package. This was as easy as running pecl install json and watching the compiler do its thing. When it’s done you should have file in your PHP modules directory. (Mine is/usr/lib/php/modules/.)
  2. Add json.ini file to /etc/php.d/ – This file is pretty simple. Simply add to this file and that will enable the extension.
  3. Restart Apache – Not much more to add here. Without the restart, the extension won’t be loaded.
  4. Profit!



Leave a Reply

Please log in using one of these methods to post your comment: Logo

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s