Countries icon indicating copy to clipboard operation
Countries copied to clipboard

Uncaught Error: Undefined constant 'JSON_THROW_ON_ERROR'

Open dimaslanjaka opened this issue 9 months ago • 2 comments

i got error

<br />
<b>Fatal error</b>:  Uncaught Error: Undefined constant 'JSON_THROW_ON_ERROR' in /var/www/html/vendor/annexare/countries-list/dist/index.php:35
Stack trace:
#0 /var/www/html/vendor/annexare/countries-list/dist/index.php(58): Annexare\Countries\load('countries.min.j...')
#1 /var/www/html/proxyWorking.php(113): Annexare\Countries\countries()
#2 {main}
  thrown in <b>/var/www/html/vendor/annexare/countries-list/dist/index.php</b> on line <b>35</b><br />

image

OS: ubuntu 18.x php: 7.2

composer.json

{
    "$schema": "https://raw.githubusercontent.com/composer/composer/main/res/composer-schema.json",
    "name": "dimaslanjaka/php-proxy-hunter",
    "description": "PHP Proxy Hunter",
    "type": "library",
    "license": "MIT",
    "autoload": {
        "psr-4": {
            "PhpProxyHunter\\": "src/"
        },
        "files": ["data/webgl.php"]
    },
    "authors": [
        {
            "name": "dimaslanjaka",
            "email": "[email protected]"
        }
    ],
    "require": {
        "composer-plugin-api": "^2.3",
        "annexare/countries-list": "^3.1",
        "geoip2/geoip2": "^2.13",
        "maxmind/web-service-common": "^0.9.0"
    }
}

dimaslanjaka avatar May 01 '24 04:05 dimaslanjaka

Yes, seems like not all versions of PHP support that.

You can add something like this for now, I'll make an update on this a bit later:

    if (!defined('JSON_THROW_ON_ERROR')) {
        define('JSON_THROW_ON_ERROR', 4194304);
    }

dmythro avatar May 01 '24 10:05 dmythro

Yes, seems like not all versions of PHP support that.

You can add something like this for now, I'll make an update on this a bit later:

    if (!defined('JSON_THROW_ON_ERROR')) {
        define('JSON_THROW_ON_ERROR', 4194304);
    }

waiting next patch

dimaslanjaka avatar May 05 '24 15:05 dimaslanjaka