Magento 2.3.3 仪表板不断加载
Magento 2.3.3 dashboard keeps loading
我已经在我的本地主机上安装了最新版本的 magento。
登录管理面板后,仪表板不断加载。
这是图片-
请帮忙解决这个错误。
首先转到magento根目录然后:
vendor/magento/framework/view/element/tempalate/file/validator.php(不要完全复制此 url 只需按照此路径)
使用任何编辑器打开此文件并更改此行
$realPath = $this->fileDriver->getRealPath($path); //you can comment this out
with this one
$realPath = str_replace('\','/',$this->fileDriver->getRealPath($path));
then goto to
app/etc/di.xml
并搜索 view_preprocessed
你会发现一整行是这样的:
Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink
并将 Symlink 更改为 Copy
Magento 2.3
转到\lib\internal\Magento\Framework\View\Element\Template\File
转到函数 isPathInDirectories 并将函数替换为以下函数
protected function isPathInDirectories($path, $directories)
{
if (!is_array($directories)) {
$directories = (array)$directories;
}
//$realPath = $this->fileDriver->getRealPath($path);
$realPath = str_replace('\','/',$this->fileDriver->getRealPath($path));
foreach ($directories as $directory) {
//$realDirectory = $this->fileDriver->getRealPath($directory);
$realDirectory = str_replace('\','/',$this->fileDriver->getRealPath($directory));
if ($realDirectory && 0 === strpos($realPath, $realDirectory)) {
return true;
}
}
return false;
}
转到 app/etc/di.xml 然后搜索 view_preprocessed
你会发现一整行是这样的:
Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink 并更改为 Magento\Framework\App\View\Asset\MaterializationStrategy\Copy
#1。前往 vendor/magento/framework/View/Element/Template/File/Validator.php#
#2。转到函数 isPathInDirectories 并将函数替换为以下内容:#
protected function isPathInDirectories($path, $directories)
{
if (!is_array($directories)) {
$directories = (array)$directories;
}
//$realPath = $this->fileDriver->getRealPath($path);
$realPath = str_replace('\','/',$this->fileDriver->getRealPath($path));
foreach ($directories as $directory) {
//$realDirectory = $this->fileDriver->getRealPath($directory);
$realDirectory = str_replace('\','/',$this->fileDriver->getRealPath($directory));
if ($realDirectory && 0 === strpos($realPath, $realDirectory)) {
return true;
}
}
return false;
}
#3。转到 app/etc/di.xml 然后搜索 view_preprocessed
你会发现一整行是这样的:
Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink 并更改为
Magento\Framework\App\View\Asset\MaterializationStrategy\Copy#
我已经在我的本地主机上安装了最新版本的 magento。
登录管理面板后,仪表板不断加载。
这是图片-
首先转到magento根目录然后:
vendor/magento/framework/view/element/tempalate/file/validator.php(不要完全复制此 url 只需按照此路径)
使用任何编辑器打开此文件并更改此行
$realPath = $this->fileDriver->getRealPath($path); //you can comment this out
with this one
$realPath = str_replace('\','/',$this->fileDriver->getRealPath($path));
then goto to
app/etc/di.xml
并搜索 view_preprocessed
你会发现一整行是这样的:
Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink 并将 Symlink 更改为 Copy
Magento 2.3
转到\lib\internal\Magento\Framework\View\Element\Template\File
转到函数 isPathInDirectories 并将函数替换为以下函数
protected function isPathInDirectories($path, $directories) { if (!is_array($directories)) { $directories = (array)$directories; } //$realPath = $this->fileDriver->getRealPath($path); $realPath = str_replace('\','/',$this->fileDriver->getRealPath($path)); foreach ($directories as $directory) { //$realDirectory = $this->fileDriver->getRealPath($directory); $realDirectory = str_replace('\','/',$this->fileDriver->getRealPath($directory)); if ($realDirectory && 0 === strpos($realPath, $realDirectory)) { return true; } } return false; }
转到 app/etc/di.xml 然后搜索 view_preprocessed
你会发现一整行是这样的:
Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink 并更改为 Magento\Framework\App\View\Asset\MaterializationStrategy\Copy
#1。前往 vendor/magento/framework/View/Element/Template/File/Validator.php# #2。转到函数 isPathInDirectories 并将函数替换为以下内容:#
protected function isPathInDirectories($path, $directories)
{
if (!is_array($directories)) {
$directories = (array)$directories;
}
//$realPath = $this->fileDriver->getRealPath($path);
$realPath = str_replace('\','/',$this->fileDriver->getRealPath($path));
foreach ($directories as $directory) {
//$realDirectory = $this->fileDriver->getRealPath($directory);
$realDirectory = str_replace('\','/',$this->fileDriver->getRealPath($directory));
if ($realDirectory && 0 === strpos($realPath, $realDirectory)) {
return true;
}
}
return false;
}
#3。转到 app/etc/di.xml 然后搜索 view_preprocessed
你会发现一整行是这样的:
Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink 并更改为 Magento\Framework\App\View\Asset\MaterializationStrategy\Copy#