【问题标题】:Magento2 SettingsMagento2 设置
【发布时间】:2019-01-04 15:09:54
【问题描述】:

当我切换 Client Side Less Compilation 并将其保存在 Magento 2.2.2 站点上时,它会引发以下错误:

500 内部服务器错误

这是日志:

[Fri Jul 27 13:13:36.324051 2018] [:error] [pid 20125] [client 5.255.250.135:46655] PHP Fatal error:  Uncaught TypeError: Argument 4 passed to Magento\\Developer\\Model\\View\\Asset\\PreProcessor\\FrontendCompilation::processContent() must be an instance of Magento\\Framework\\View\\Asset\\File\\FallbackContext, instance of Magento\\Framework\\View\\Asset\\File\\Context given, called in /var/www/html/vendor/magento/module-developer/Model/View/Asset/PreProcessor/FrontendCompilation.php on line 90 and defined in /var/www/html/vendor/magento/module-developer/Model/View/Asset/PreProcessor/FrontendCompilation.php:107\nStack trace:\n#0 /var/www/html/vendor/magento/module-developer/Model/View/Asset/PreProcessor/FrontendCompilation.php(90): Magento\\Developer\\Model\\View\\Asset\\PreProcessor\\FrontendCompilation->processContent('15859f29777d5d9...', '@import 'third-...', '', Object(Magento\\Framework\\View\\Asset\\File\\Context))\n#1 /var/www/html/vendor/magento/module-developer/Model/View/Asset/PreProcessor/PreprocessorStrategy.php(74): Magento\\Developer\\Model\\View\\Asset\\PreProcessor\\FrontendCompilation->process(Object(Magento\\Framework\\View\\As in /var/www/html/vendor/magento/module-developer/Model/View/Asset/PreProcessor/FrontendCompilation.php on line 107

我只能访问 SSH 和 SFTP,我该如何解决这个问题? 我很感激任何答案。

【问题讨论】:

    标签: php magento magento2 administrator


    【解决方案1】:

    从您的 magento 根目录运行 php bin/magento setup:di:compile 命令。

    【讨论】:

    • [Exception] Warning: is_file() expects parameter 1 to be a valid path, string given in /var/www/html/vendor/colinmollenhour/cache-backend-file/File.php on line 51 2 setup:di:compile
    • 如何返回我的配置?
    • 如果我让你 ssh 你能解决它吗?
    • @DimaMorgunov yaa 确定 ...我会修复它
    【解决方案2】:

    找到路径dev/front_end_development_workflow/type,如果值为client_side_compilation,则将其更改为server_side_compilation。再次清除所有缓存并运行rm -rf var/cache/*

    【讨论】:

      猜你喜欢
      • 2017-06-02
      • 2015-12-16
      • 1970-01-01
      • 2013-07-13
      • 2017-11-23
      • 1970-01-01
      • 2015-12-16
      • 2018-12-11
      • 1970-01-01
      相关资源
      最近更新 更多