1.3.14升级到 1.5.2时遇到function get() on null错误

banro512

问题描述

很久没升级了,打算升级下,执行升级命令 composer require workerman/webman-framework ^1.4.7 && composer require webman/console ^1.2.12 && php webman install

程序代码

composer require workerman/webman-framework ^1.4.7 && composer require webman/console ^1.2.12 && php webman install

报错信息

PHP Fatal error:  Uncaught Error: Call to a member function get() on null in /www/wwwroot/diancifaapi/vendor/workerman/webman-framework/src/support/Container.php:46
Stack trace:
#0 /www/wwwroot/diancifaapi/vendor/webman/console/src/Command.php(38): support\Container::__callStatic()
#1 /www/wwwroot/diancifaapi/vendor/webman/console/src/Command.php(13): Webman\Console\Command->installCommands()
#2 /www/wwwroot/diancifaapi/webman(17): Webman\Console\Command->installInternalCommands()
#3 {main}
  thrown in /www/wwwroot/diancifaapi/vendor/workerman/webman-framework/src/support/Container.php on line 46

截图报错信息里报错文件相关代码

/www/wwwroot/diancifaapi/vendor/workerman/webman-framework/src/support/Container.php
第46行代码

 43     public static function __callStatic(string $name, array $arguments)
 44     {
 45         $plugin = \Webman\App::getPluginByClass($name);
 46         return static::instance($plugin)->{$name}(... $arguments);
 47     }

操作系统及workerman/webman等框架组件具体版本

composer镜像已恢复官方默认

centos7.8
webman 1.3.14

PHP 8.1.9 (cli) (built: Aug 9 2022 10:39:55) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.9, Copyright (c) Zend Technologies

782 1 0
1个回答

walkor 打赏

如果有问题就重新创建一个项目,然后把业务目录app拷贝进去

  • 暂无评论
年代过于久远,无法发表回答
×
🔝