if your magento installation is running on windows than in magento's some versions like in 2.2.7 we have to replace the code of file vendor/magento/framework/view/element/template/file/validator.php with this.

protected function isPathInDirectories($path, $directories)
{
    $realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
    if (!is_array($directories)) {
        $directories = (array)$directories;
    } 

    foreach ($directories as $directory) {
        if (0 === strpos($realPath, $directory)) {
            return true;
        }
    }
    return false;
}

and now reload the magento application.

if your magento installation is running on windows than in magento's some versions like in 2.2.7 we have to replace the code of file vendor/magento/framework/view/element/template/file/validator.php with this.

protected function isPathInDirectories($path, $directories)
{
    $realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
    if (!is_array($directories)) {
        $directories = (array)$directories;
    }
foreach ($directories as $directory) {
    if (0 === strpos($realPath, $directory)) {
        return true;
    }
}
return false;
}

and now reload the magento application.

if your magento installation is running on windows than in magento's some versions like in 2.2.7 we have to replace the code of file vendor/magento/framework/view/element/template/file/validator.php with this.

protected function isPathInDirectories($path, $directories)
{
    $realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
    if (!is_array($directories)) {
        $directories = (array)$directories;
    } 

    foreach ($directories as $directory) {
        if (0 === strpos($realPath, $directory)) {
            return true;
        }
    }
    return false;
}

and now reload the magento application.

Source Link

if your magento installation is running on windows than in magento's some versions like in 2.2.7 we have to replace the code of file vendor/magento/framework/view/element/template/file/validator.php with this.

protected function isPathInDirectories($path, $directories)
{
    $realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));
    if (!is_array($directories)) {
        $directories = (array)$directories;
    }
foreach ($directories as $directory) {
    if (0 === strpos($realPath, $directory)) {
        return true;
    }
}
return false;
}

and now reload the magento application.