Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Error: Undefined constant 'JSON_THROW_ON_ERROR' #138

Open
dimaslanjaka opened this issue May 1, 2024 · 2 comments
Open

Uncaught Error: Undefined constant 'JSON_THROW_ON_ERROR' #138

dimaslanjaka opened this issue May 1, 2024 · 2 comments

Comments

@dimaslanjaka
Copy link

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"
    }
}
@dmythro
Copy link
Member

dmythro commented May 1, 2024

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);
    }

@dimaslanjaka
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants