I want to install the JSON extension as is mentioned in prerequisites to use People Api by Google. You can refer to the documentation. I've php7 installed on Ubuntu 16.04.
Asked
Active
Viewed 1.5k times
1
-
I don't see where it is stated to install JSON extension, I believe Ubuntu programs can read that file already – George Udosen May 29 '17 at 06:00
-
@George "PHP 5.4 or greater with the command-line interface (CLI) and JSON extension installed." Copy/pasted line from the link I just shared, right under Prerequisites Heading. – naan May 29 '17 at 06:02
-
Than How to check If it's installed or not? – naan May 29 '17 at 06:03
-
1Verify JSON extention installed or not using this command : `apt-cache policy php5-json` for php5.x and for `apt-cache policy php-json` for php7 – Nullpointer May 29 '17 at 06:04
-
Ok I see it's for php not Ubuntu per say – George Udosen May 29 '17 at 06:05
-
@Ravi I've installed php7. The command you mentioned is returning "Unable to locate package php5-json" – naan May 29 '17 at 06:07
-
1Please check if its there with `php -m | grep -i json` or `sudo dpkg --list | grep php | grep -i json` – George Udosen May 29 '17 at 06:07
-
@naan Here update me comment, please check again – Nullpointer May 29 '17 at 06:08
-
@naan please check with `sudo dpkg --list | grep php | grep -i json` – George Udosen May 29 '17 at 06:10
-
1@George your command worked. It is already installed. Thanks – naan May 29 '17 at 06:10
-
@Ravi your command also worked. It is already installed. Thanks – naan May 29 '17 at 06:11
2 Answers
2
JSON support comes pre-compiled with current php versions you can check for installed php extensions with:
php -m
And to check which is installed for the current php versions use:
sudo dpkg --list | grep php | grep -i <extension_name>
George Udosen
- 35,970
- 13
- 99
- 121