magento2 - magento-cloud 没有在 app/etc 中正确创建文件,Magento 2 无法实例化
问题描述
我有一个 Magento2 云专业版设置。我根据本地环境设置的说明创建了一个本地开发环境
我的设置
Ubuntu 18.04 服务器,Nginx,PHP FPM 7.1 - 来自 andre ppa,MariaDB
我的本地开发人员是几周前创建的虚拟机,直到昨天它工作正常。我昨天还在物理硬件上从头开始制作了相同设置的副本,以进行从 1x 到 2x 的迁移。
当我使用magento-cloud
工具使用新服务器构建环境时,命令magento-cloud
build创建了一个新符号链接,_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 文件夹结构等。如果我什么都不做,不更改文件并再次执行相同的命令,它会因为丢失而失败文件。
解决方案
弄清楚了。在运行命令 magento-cloud build 之前,需要运行 composer update,这就是创建文件的原因。不确定此步骤是否在文档中。
推荐阅读
- bash - bash 脚本将两个变量值打印到同一行序列中
- powershell - 如果请求在 Powershell 中失败。怎么修?
- python - 用 Python 编写一个客户端来调用一个使用 JWT 身份验证的 REST Web 服务
- reactjs - React 应用程序在 IE11 中不起作用(已尝试过 polyfills)
- ffmpeg - 输入区域 0:0:1280:675 不在填充区域 0:0:1280:674 内或大小为零
- mysql - SQL查询多列并排序
- cors - 尝试使用 Auth0 对用户进行身份验证时出现 CORS 错误
- c - 即使在 C 中遇到 null 后,如何继续从某个位置打印?
- swift - 使用 Swift 从 Firebase 数据库中检索
- python - 从 python 脚本更新文件后,在 docker 中复制的 Json 文件不会更改