【发布时间】:2021-07-29 13:48:17
【问题描述】:
当我在 cmd 上运行 php bin/magento setup:di:compile 时会发生此错误:
编译已开始。 插件列表生成... 8/9 [=========================>---] 88% 10 分钟 392.0 MiB 在 ErrorHandler.php 第 61 行: 警告:file_put_contents(C:/xampp/htdocs/magento/generated/metadata/primary|global|plugin-list.php):无法打开流:C:\xampp 中没有这样的文件或目录 \htdocs\magento\vendor\magento\framework\Interception\PluginListGenerator.php 在第 415 行 设置:di:编译
然后我在互联网上看到了解决方案,我发现如果我更换这个
$cacheId = implode('|', $this->scopePriorityScheme) . "|" . $this->cacheId;
与$cacheId = implode(‘-’, $this->scopePriorityScheme) . “-” . $this->cacheId;
然后此错误将解决,但会产生一个新错误:
不推荐使用的功能:包含两个“.”的无括号表达式的行为并且 '+'/'-' 将在 PHP 8 中更改:'+'/'-' 将在第 159 行的 C:\xampp\htdocs\magento\vendor\magento\framework\Interception\PluginListGenerator.php 中获得更高的优先级
当我放弃所有以前的更改然后再次发生第一个错误时,此错误就会解决
【问题讨论】:
-
所以,修复第二个错误,不要恢复更改。
-
第二个错误的解决方法是这个 chages $cacheId = implode('-', $this->scopePriorityScheme) 。 “-”。 $this->cacheId;到 $cacheId = implode('|', $this->scopePriorityScheme) 。 “|” . $this->cacheId;我改变它以解决第一个错误。
-
不,第二个错误的解决方案不是恢复更改,而是修复您收到的“不推荐使用的功能”警告 - 这很自我解释。
标签: php magento installation