Question: I have installed magento 2 on xampp but i have errors on admin and front page

[![enter image description here](https://i.stack.imgur.com/dZVRm.png)](https://i.stack.imgur.com/dZVRm.png)

[![enter image description here](https://i.stack.imgur.com/mAcp0.png)](https://i.stack.imgur.com/mAcp0.png)

Any idea?

Answer: 
To resolve this issue on the localhost.

> 
> vendor/magento/framework/View/Element/Template/File/Validator.php
> 
> 
> 

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.

The answer already accepted here: <https://magento.stackexchange.com/a/304239/59677>
This is Magento 2 bug. And it is fixed. 

Please go this file path :- 

**/vendor/magento/framework/View/Element/Template/File/Validator.php:140**

the string

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

**to replace**

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

And your Magento version is 2.3.3 is lower so refer this links :- 

[Magento 2.2.7 admin panel blank page](https://magento.stackexchange.com/questions/252188/magento-2-2-7-admin-panel-blank-page)

Hope help you. 

Thanks.