Added a check for the json extension

Debian unstable compiled PHP without the json extension because of
a license issue with the JSON parser used by PHP.