当前位置: 首页 > 工具软件 > PHP Console > 使用案例 >

console未定义php,ThinkPHP命令行运行报错'think\Console' not found

郑西岭
2023-12-01

环境Thinkphp5.1命令行执行php s1.php

错误提示:PHP Fatal error: Uncaught Error: Class 'think\Console' not found in /www/***/vendor/topthink/think-worker/src/command.php:12

Stack trace:

#0 /www/***/vendor/composer/autoload_real.php(66): require()

#1 /www/***/vendor/composer/autoload_real.php(56): composerRequire29d161512c2a2356c427813fcdcc5018('ffc1d7141d4fcba...', '/www/wwwroot/tp...')

#2 /www/***/vendor/autoload.php(7): ComposerAutoloaderInit29d161512c2a2356c427813fcdcc5018::getLoader()

#3 /www/***/s1.php(26): require_once('/www/wwwroot/tp...')

#4 {main}

thrown in /www/***/vendor/topthink/think-worker/src/command.php on line 12代码 s1.php// 标记是全局启动

define('GLOBAL_START', 1);

require_once __DIR__ . '/vendor/autoload.php';

// 加载所有Applications/*/start.php,以便启动所有服务

// foreach (glob(__DIR__ . '/ws/*/start*.php') as $start_file) {

// require_once $start_file;

// }

// 运行所有服务

Worker::runAll();我的疑问

1.为什么他会报错 'think\Console' not found,我并没有调用think相关代码呀?

 类似资料: