用 composer 将 fecmall 从 2.16 升级到 2.2.1,发现后台页面都打不开了

FecMall问题咨询 · Alien · 于 5年前 发布 · 2472 次阅读

用 composer 将 fecmall 从 2.16 升级到 2.2.1,发现前后台页面都打不开了

D:\web\fecshop
λ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 11 updates, 0 removals
  - Updating yiisoft/yii2 (2.0.25 => 2.0.26): Downloading (100%)
  - Updating fancyecommerce/fecshop (2.1.6 => 2.2.1): Downloading (100%)
  - Updating symfony/dom-crawler (v4.3.3 => v4.3.4): Downloading (100%)
  - Updating symfony/browser-kit (v4.3.3 => v4.3.4): Downloading (100%)
  - Updating symfony/service-contracts (v1.1.5 => v1.1.6): Downloading (100%)
  - Updating symfony/console (v4.3.3 => v4.3.4): Downloading (100%)
  - Updating symfony/css-selector (v4.3.3 => v4.3.4): Downloading (100%)
  - Updating symfony/event-dispatcher (v4.3.3 => v4.3.4): Downloading (100%)
  - Updating symfony/finder (v4.3.3 => v4.3.4): Downloading (100%)
  - Updating symfony/yaml (v4.3.3 => v4.3.4): Downloading (100%)
  - Updating phpunit/phpunit (7.5.14 => 7.5.15): Downloading (100%)
Package phpoffice/phpexcel is abandoned, you should avoid using it. Use phpoffice/phpspreadsheet instead.
Writing lock file
Generating autoload files

如图,用 composer 将 fecmall 从 2.16 升级到 2.2.1 后,后台主页打不开了,提示:Child Service [admin] does not exist in fecshop\services\Application, you must config it!

后来,参照官方升级文档操作,执行如下操作:

  1. 直接将文件:https://github.com/fecshop/yii2_fecshop_app_advanced/blob/master/composer.json 里面的内容覆盖本地fecshop根目录的 composer.json文件

  2. 执行composer selfupdate

  3. 执行composer update

  4. 执行yii migrate --interactive=0 --migrationPath=@fecshop/migrations/mysqldb

D:\web\fecshop
composer selfupdate
You are already using composer version 1.9.0 (stable channel).

D:\web\fecshop
λ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package phpoffice/phpexcel is abandoned, you should avoid using it. Use phpoffice/phpspreadsheet instead.
Writing lock file
Generating autoload files

D:\web\fecshop
λ yii migrate --interactive=0 --migrationPath=@fecshop/migrations/mysqldb
Yii Migration Tool (based on Yii v2.0.26)

No new migrations found. Your system is up-to-date.

还是没有解决。求助

本文由 Alien 创作,采用 知识共享署名 3.0 中国大陆许可协议 进行许可。 可自由转载、引用,但需署名作者且注明文章出处。

共收到 7 条回复
Fecmall#25年前 0 个赞

admin service :https://github.com/fecshop/yii2_fecshop/blob/master/services/Admin.php

admin service config:https://github.com/fecshop/yii2_fecshop/blob/master/config/services/Admin.php

Yii::$service->admin 是通过https://github.com/fecshop/yii2_fecshop/blob/master/services/Service.php#L66 这个方法:getChildService($childServiceName),去找的

您自己调试一下,找找原因

我本地是没有问题的,无法重现,因此无法帮助,只能提示一下,你调试一下代码看看

jerou#35年前 3 个赞

找了好久,终于找到问题所在。 appadmin/web/index.php 文件倒数第五行 new fecshop\services\Application($config['services']); 改为new fecshop\services\Application($config); 即可。 其他模块也一样。

from jerou;

Fecmall#45年前 0 个赞

不错不错,找到原因了

这个新版本这个部分进行了调整,如果直接安装fecmall-2.2是没有问题的,外层包需要手动更新

Alien#55年前 0 个赞

@jerou #3楼 @Fecmall #2楼 谢谢!

vividblue#64年前 0 个赞

我纠结了一天啊...总算找到原因了,fecshop\services\Application($config['services']); 改为new fecshop\services\Application($config); 。这个有点坑了,希望更新下代码:smiley: :smiley:

Fecmall#74年前 0 个赞

升级文档:http://www.fecmall.com/doc/fecshop-guide/develop/cn-2.0/guide-fecshop-2-about-update.html

外层包需要手动更新,外层包的好处是前期变动可能大,但是稳定后很少改动,更多的是vendor/fancyecommerce/fecshop里面的文件改动。

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics