php - Magento 错误类 ../validator 不存在
问题描述
我刚刚安装了 Magento2 平台。管理页面是空白的,显示没有任何内容的灰屏。我启用了显示错误,然后显示此错误,但我没有找到任何解决方案或原因:
处理您的请求时出错
Magento\Framework\View\Element\Template\File\Validator 类不存在
解决方案
检查以下路径。如果您的 magento 管理页面为空白,请检查路径:
magento_root_dir\vendor\magento\framework\View\Element\Template\File\Validator.php
并更改以下行:
if (0 === strpos($realPath, $directory)) {
return true;
}
至:
if (0 === strpos($path, $directory)) {
return true;
}
如果仍然无法找到该文件夹,请检查以下路径:
magento_root_dir\lib\internal\Magento\Framework\View\Element\Template\File\Validator.php
推荐阅读
- mysql - 转换用户输入 tp MYSQL TIME 文字
- c# - 存储过程在范围标识上返回 0
- python - 如何在本地 Python 项目的 Yocto 配方中安装 requirements.txt 的依赖项
- xslt - 如何在 xslt 或 xsl-fo 中按预期在 for 循环中进行排序(按字母顺序排列)?
- python - 为什么我在使用此 GCP App Engine 应用时没有收到 DeadlineExceededError?
- wget - 如何使用 wget 从默认服务器上下文根以外的位置获取文件?
- java - JavaFX - 每个设备的 POM、UI 和控制器
- vb.net - 如何在 VB.NET 中用 DataTable 列名填充 ComboBox?
- cmake - 如何在 CMAKEList 中执行外部批处理文件
- python-3.x - python - 如何在Python中的轴上投影某些值?