Install magento 2 on my premises and I have these errors and I can't see the system

enter image description here

Already use the following commands

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento setup:di:compile
php bin/magento cache:flush
php bin/magento cache:clean

But this does not solve my problem, the maximum I can see on the screen is this

enter image description here

How can I solve these errors?


1 Answer 1


To resolve this issue on the localhost.


Find the below code

if (0 === strpos($realPath, $directory)) {
    return true;

And replace it with

$realDirectory = $this->fileDriver->getRealPath($directory);
if ($realDirectory && 0 === strpos($realPath, $realDirectory)) {
   return true;

Then flush the cache and your issue will be resolved.

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.