• Magento2-2.3.4 windows安装完magento无法加载静态资源导致无法进入后台登录页面


    后台面无法进入,截图如下

    首先查看var/log/system.log日志文件,发现报错信息如下

    RROR: Error: Application is not installed yet.  [] []
    [2020-03-25 00:16:08] main.ERROR: Unable to proceed: the maintenance mode is enabled.  [] []
    [2020-03-25 00:53:11] main.ERROR: Unable to proceed: the maintenance mode is enabled.  [] []
    [2020-03-25 12:27:55] main.ERROR: Unable to proceed: the maintenance mode is enabled.  [] []
    [2020-03-25 12:39:38] main.ERROR: Unable to proceed: the maintenance mode is enabled.  [] []
    [2020-03-25 12:42:31] main.ERROR: Unable to proceed: the maintenance mode is enabled.  [] []
    [2020-03-25 12:56:42] main.ERROR: Unable to proceed: the maintenance mode is enabled.  [] []
    [2020-03-25 13:03:11] main.CRITICAL: Invalid template file: 'D:/phpstudy_pro/WWW/magento2-2.3.4/app/code/Magento/Backend/view/adminhtml/templates/page/js/require_js.phtml' in module: 'Magento_Backend' block's name: 'require.js' [] []
    [2020-03-25 13:03:11] main.CRITICAL: Invalid template file: 'D:/phpstudy_pro/WWW/magento2-2.3.4/app/code/Magento/Translation/view/base/templates/translate.phtml' in module: 'Magento_Translation' block's name: 'translate' [] []
    [2020-03-25 13:03:11] main.CRITICAL: Invalid template file: 'D:/phpstudy_pro/WWW/magento2-2.3.4/app/code/Magento/Backend/view/adminhtml/templates/page/js/components.phtml' in module: '' block's name: 'head.components' [] []
    [2020-03-25 13:03:11] main.CRITICAL: Invalid template file: 'D:/phpstudy_pro/WWW/magento2-2.3.4/app/code/Magento/Backend/view/adminhtml/templates/page/js/calendar.phtml' in module: '' block's name: 'head.calendar' [] []
    [2020-03-25 13:03:11] main.CRITICAL: Invalid template file: 'D:/phpstudy_pro/WWW/magento2-2.3.4/app/code/Magento/Cookie/view/base/templates/html/cookie.phtml' in module: '' block's name: 'cookie_config' [] []
    [2020-03-25 13:03:11] main.CRITICAL: Invalid template file: 'D:/phpstudy_pro/WWW/magento2-2.3.4/app/code/Magento/Ui/view/base/templates/logger.phtml' in module: 'Magento_Ui' block's name: 'logger' [] []
    [2020-03-25 13:03:11] main.CRITICAL: Invalid template file: 'D:/phpstudy_pro/WWW/magento2-2.3.4/app/code/Magento/Ui/view/base/templates/wysiwyg/active_editor.phtml' in module: 'Magento_Ui' block's name: 'theme.active.editor' [] []
    [2020-03-25 13:03:11] main.CRITICAL: Invalid template file: 'D:/phpstudy_pro/WWW/magento2-2.3.4/app/code/Magento/Backend/view/adminhtml/templates/page/header.phtml' in module: 'Magento_Backend' block's name: 'logo' [] []

    解决方法

    找到libinternalMagentoFrameworkViewElementTemplateFileValidator.php文件中的isPathInDirectories方法

    $realPath = str_replace('\', '/', $this->fileDriver->getRealPath($path));替换$realPath = $this->fileDriver->getRealPath($path);

    看结果

    如果还是不行,可以尝试如下操作

    INSERT INTO core_config_data (path, value) VALUES ('dev/static/sign', 0) ON DUPLICATE KEY UPDATE value = 0;

    php bin/magento cache:clean

    如果登录页面可以打开,但是图片和CSS报404,可以执行正面命令

    sudo php bin/magento setup:static-content:deploy -f
    sudo php bin/magento cache:flush

    如果登录页面打不开只显示No input file specified.

    请检查 var/cache缓存目录是否有写入权限,如果没有执行正面命令

    sudo chmod 777 var/cache -R

     如果登录页面打不开,然后exception报class not exist,执行正面命令

    sudo php bin/magento setup:di:compile
    sudo php bin/magento cache:flush
  • 相关阅读:
    thymeleaf 模板引擎
    thymeleaf 内联语法
    thymeleaf 局部变量、属性优先级、注释
    PYNQ上手笔记 | ① 启动Pynq
    MSP430F5529时钟系统深究
    C#上位机开发(四)—— SerialAssistant功能完善
    C#上位机开发(三)—— 构建SerialAssistant雏形
    C#上位机开发(二)—— Hello,World
    C#上位机开发(一)—— 了解上位机
    FPGA学习笔记(八)—— 状态机设计实例之独立按键消抖
  • 原文地址:https://www.cnblogs.com/IT-Crowd/p/12571611.html
Copyright © 2020-2023  润新知