webman 引入di后启动不了了

jesse

问题描述

使用了webman的依赖注入,但是引入组件后服务启动不起来了

程序代码或配置

composer require psr/container ^1.1.1 php-di/php-di ^6 doctrine/annotations ^1.14

重现问题的步骤

vendor包中文件已存在

(base) [root@VM-0-11-centos src]# ls -l
total 80
drwxr-xr-x 2 root root  4096 Apr 10  2022 Annotation
-rw-r--r-- 1 root root  4387 Apr 10  2022 CompiledContainer.php
drwxr-xr-x 2 root root  4096 Apr 10  2022 Compiler
-rw-r--r-- 1 root root 11401 Apr 10  2022 ContainerBuilder.php
-rw-r--r-- 1 root root 13819 Apr 10  2022 Container.php
drwxr-xr-x 8 root root  4096 Apr 10  2022 Definition
-rw-r--r-- 1 root root   224 Apr 10  2022 DependencyException.php
drwxr-xr-x 2 root root  4096 Apr 10  2022 Factory
-rw-r--r-- 1 root root  1002 Apr 10  2022 FactoryInterface.php
-rw-r--r-- 1 root root  4446 Apr 10  2022 functions.php
drwxr-xr-x 2 root root  4096 Apr 10  2022 Invoker
-rw-r--r-- 1 root root   263 Apr 10  2022 NotFoundException.php
drwxr-xr-x 2 root root  4096 Apr 10  2022 Proxy

但是报错

Error: Class 'DI\ContainerBuilder' not found in /app/code/playapi/config/container.php:16
Stack trace:
#0 /app/code/playapi/vendor/workerman/webman-framework/src/Config.php(207): include()
#1 /app/code/playapi/vendor/workerman/webman-framework/src/Config.php(63): Webman\Config::loadFromDir()
#2 /app/code/playapi/vendor/workerman/webman-framework/src/support/App.php(141): Webman\Config::load()
#3 /app/code/playapi/support/bootstrap.php(48): support\App::loadAllConfig()
#4 /app/code/playapi/vendor/workerman/webman-framework/src/support/App.php(104): require_once('/app/code/playa...')
#5 /app/code/playapi/vendor/workerman/workerman/Worker.php(2497): support\App::support\{closure}()
#6 /app/code/playapi/vendor/workerman/workerman/Worker.php(1636): Workerman\Worker->run()
#7 /app/code/playapi/vendor/workerman/workerman/Worker.php(1429): Workerman\Worker::forkOneWorkerForLinux()

操作系统环境及workerman/webman等具体版本

os:linux
webman:^1.5.0

299 1 0
1个回答

walkor 打赏

composer安装完后要restart重启webman

  • jesse 2024-08-26

    也重启了 但是没生效没读到不知道为啥

×
🔝