0

I installed a Magento extension and after running php bin/magento setup:upgrade, I get the following errors. I've tried hours trying to find a solution. I even got my server company to help, but no luck.

I'm running Magento 2.3.4 with PHP version 7.2

PHP Fatal error:  Uncaught Error: Call to undefined function JsonSchema\Uri\filter_var() in /home/thesuitexchange/thesuitexchange/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php:82
    Stack trace:
    #0 /home/thesuitexchange/thesuitexchange/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php(100): JsonSchema\Uri\UriResolver->resolve('file:///home/th...', 'internal://prov...')
    #1 /home/thesuitexchange/thesuitexchange/vendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.php(72): JsonSchema\SchemaStorage->expandRefs(Object(stdClass), 'internal://prov...')
    #2 /home/thesuitexchange/thesuitexchange/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php(58): JsonSchema\SchemaStorage->addSchema('internal://prov...', Object(stdClass))
    #3 /home/thesuitexchange/thesuitexchange/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php(78): JsonSchema\Validator->validate(Object(stdClass), Object(stdClass))
    #4 /home/thesuitexchange/thesuitexchange/vendor/composer/composer/src/Composer/Json/Jso in /home/thesuitexchange/thesuitexchange/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php on line 82
2
  • I think "filter" extension not enabled on your PHP. Commented Feb 8, 2020 at 6:31
  • you need to uninstall that module. Commented Feb 10, 2020 at 11:08

2 Answers 2

0

The problem occurs because ext-filter not enabled or installed.

Need to install ext-filter module. I guess it should be enabled by default.

Alternatively, you can use other approaches on the code side instead of filter_var().

  1. https://stackoverflow.com/a/4154711
  2. https://stackoverflow.com/a/1544403
0

Here is the tutorial for you to set up library justinrainbow: https://github.com/pepe1518/magento2/tree/master/vendor/justinrainbow/json-schema

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.