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
-
I think "filter" extension not enabled on your PHP.Kishor Thummar– Kishor Thummar2020年02月08日 06:31:46 +00:00Commented Feb 8, 2020 at 6:31
-
you need to uninstall that module.Sarvesh Patel– Sarvesh Patel2020年02月10日 11:08:25 +00:00Commented Feb 10, 2020 at 11:08
2 Answers 2
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().
Here is the tutorial for you to set up library justinrainbow: https://github.com/pepe1518/magento2/tree/master/vendor/justinrainbow/json-schema