Add check for json module in PHP

Debian no longer ships JSON support built in into PHP because of some
licensing issues found in the PHP 5.5 and others might follow, so we
need to check whether JSON module is there.