首页 > 解决方案 > magento-cloud 没有在 app/etc 中正确创建文件,Magento 2 无法实例化

问题描述

我有一个 Magento2 云专业版设置。我根据本地环境设置的说明创建了一个本地开发环境

我的设置

Ubuntu 18.04 服务器,Nginx,PHP FPM 7.1 - 来自 andre ppa,MariaDB

我的本地开发人员是几周前创建的虚拟机,直到昨天它工作正常。我昨天还在物理硬件上从头开始制作了相同设置的副本,以进行从 1x 到 2x 的迁移。

当我使用magento-cloud工具使用新服务器构建环境时,命令magento-cloudbuild创建了一个新符号链接,_www该符号链接没有在我的 VM 环境中创建。它也没有在app/etc目录中创建任何文件。在我的 VM 环境中创建了文件。今天我删除了我的虚拟机盒子上的 Magento2 文件夹,它的行为与物理硬件相同。没有在app/etc目录中创建文件,但以前它可以正常工作。

谁能确认这个问题?

未创建文件的结果会产生错误:

[2018-07-12 04:02:44] 信息:输出:数组(0 =>'PHP 致命错误:未捕获错误:无法在 /home/magento/magento2/vendor/magento 中实例化接口 Magento\Framework\Config\CacheInterface /framework/ObjectManager/Factory/Dynamic/Developer.php:50', 1 => '堆栈跟踪:', 2 => '#0 /home/magento/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php( 70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create(\'Magento\\Framewo...\')', 3 => '#1 /home/magento/magento2/vendor/magento/framework /ObjectManager/Factory/AbstractFactory.php(144): Magento\Framework\ObjectManager\ObjectManager->get(\'Magento\\Framewo...\')', 4 => '#2 /home/magento/magento2/供应商/magento/framework/ObjectManager/Factory/AbstractFactory.php(230):Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, \'Magento\\Framewo...\', NULL, \'cache\', \'Magento\\Framewo...\')', 5 => '#3 /home/magento/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime(\'Magento\\Framewo ...\', Array, Array)', 6 => '#4 /home/magento/m in /home/magento/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php 第 50 行', ) [2018-07-12 04:02:44] CRITICAL:命令 php bin/magento 模块:启用 --all 返回代码 255)', 5 => '#3 /home/magento/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime(\' Magento\\Framewo...\', Array, Array)', 6 => '#4 /home/magento/m in /home/magento/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer. php on line 50', ) [2018-07-12 04:02:44] CRITICAL: 命令 php bin/magento module:enable --all 返回代码 255)', 5 => '#3 /home/magento/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime(\' Magento\\Framewo...\', Array, Array)', 6 => '#4 /home/magento/m in /home/magento/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer. php on line 50', ) [2018-07-12 04:02:44] CRITICAL: 命令 php bin/magento module:enable --all 返回代码 255#4 /home/magento/m 在 /home/magento/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php 第 50 行,) [2018-07-12 04:02:44] CRITICAL : 命令 php bin/magento module:enable --all 返回代码 255#4 /home/magento/m 在 /home/magento/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php 第 50 行,) [2018-07-12 04:02:44] CRITICAL : 命令 php bin/magento module:enable --all 返回代码 255

第一次执行magento-cloud构建时,它会 100% 无错误地完成,创建 Magento 文件夹结构等。如果我什么都不做,不更改文件并再次执行相同的命令,它会因为丢失而失败文件。

标签: magento2

解决方案


弄清楚了。在运行命令 magento-cloud build 之前,需要运行 composer update,这就是创建文件的原因。不确定此步骤是否在文档中。


推荐阅读