出现这种情况的基本上是windows机做服务器的情况,一般是文件验证做怪
修改以下位置文件
M2.4.X 位置为 vendor\magento\framework\View\Element\Template\File\Validator.php
M2.3.1 位置为 lib\internal\Magento\Framework\View\Element\Template\File\Validator.php
找到下面的这一些并修改
改以下位置文件
public function isValid($filename)
{
$filename = str_replace('\\', '/', $filename);
if (!isset($this->_templatesValidationResults[$filename])) {
$this->_templatesValidationResults[$filename] =
($this->isPathInDirectories($filename, $this->_compiledDir)
|| $this->isPathInDirectories($filename, $this->moduleDirs)
|| $this->isPathInDirectories($filename, $this->_themesDir)
|| $this->_isAllowSymlinks)
&& $this->getRootDirectory()->isFile($this->getRootDirectory()->getRelativePath($filename));
}
return $this->_templatesValidationResults[$filename];
}
修改为
public function isValid($filename)
{
return true;
}