Problem with JSON PHP extension.

March 11, 2014 3.7k views
Hello, how i can install that extension? I install cURL and that's ok.. but now i need to install that. I create facebook connect on my web page. Here is link with my error : *i send ticket for this.. and i'am sorry.. now i see this community.
6 Answers
sudo apt-get install php5-common
when i do that i get this :

Reading package lists... Done
Building dependency tree
Reading state information... Done
php5-common is already the newest version.

And my error is this :
"Fatal error: Uncaught exception 'Exception' with message 'Facebook needs the JSON PHP extension.' in /var/www/ Stack trace: #0 /var/www/ require_once() #1 /var/www/ include('/var/www/stefan...') #2 {main} thrown in /var/www/ on line 22"

I would try enabling the extension in your php5 config file. It might vary depending on your Linux distro and version of php you're using. Google will surely help you.
What result do you get if you run this PHP snippet:

echo function_exists( 'json_decode' );

The JSON extension is included by default in PHP, but just to be sure, you can verify it by looking through PHP's info output:

The JSON extension is no longer included with the base php package, you need to install it separately:
sudo apt-get install php5-json

That did the trick... thanks.

Have another answer? Share your knowledge.