I have a simple website hosted on a shared Linux server (by a company whose logo is an alligator). The default PHP version is 5.6.30. The cpanel for the server provides a page called MultiPHP Manager that enables me to update my site to PHP 7.x (same problem appears whether it's 7.0, 7.2, 7.3, or 7.4).
After updating to 7.x, the PHP JSON module seems to be missing (not reported in phpinfo()) when I run PHP through the web server (CGI, I think), but there is JSON support at the shell level.
I made this test file:
<?php
if (function_exists('json_decode')) {
echo "JSON enabled";
}
else echo "JSON NOT enabled";
If I get a bash shell with ssh and run php json.php, it works (says enabled). But, if I run this file via the web server in public_html, it comes back disabled.
The tech support for the hosting service has been useless.