Articles Comments

Install JSON for PHP 5

SHARE: Share

I wanted to install a Facebook application on a new VPS server but I got this error message:

Fatal error: Uncaught exception ‘Exception’ with message ‘Facebook needs the JSON PHP extension

Basically, what we need is to install the JSON PHP extension.

Here is how to do that.

Step one: run this command: pecl install json
When it’s done you should have a json.so file in your PHP modules directory. This directory should be /usr/lib/php/modules/
Step two: Add the json.ini file to /etc/php.d/ – to enable the extension add extension=json.so to this file
Step three: Restart Apache
Keep in mind that without restarting, the extension won’t be loaded.

That’s all folks! :)

Was this post useful? Buy me a beer.

Incoming search terms:

Written by

If you need someone to code/fix your site, contact me here.

Filed under: Web development · Tags: , ,

Leave a Reply