php think service:discover handling the post-autoload-dump event returned with error code 25解决

在尝试卸载Think-Swoole扩展后,发现旧的swoole.php配置文件仍然存在于config目录下,导致PHP运行时出现错误。删除这个文件并执行composer update可以消除警告和错误。问题出在未定义的常量引用,如SWOOLE_PROCESS和SWOOLE_SOCK_TCP,以及调用了未加载的swoole_cpu_num()函数。执行上述操作后,系统将能正常初始化并避免未来PHP版本中的错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

之前安装了think-swoole,后来又卸载了
但是swoole.php还在config目录下,把swoole.php删除,再执composer update就可以了

PHP Warning:  Use of undefined constant SWOOLE_PROCESS - assumed 'SWOOLE_PROCESS' (this will throw an Error in a future version of PHP) in D:\phpstudy_pro\WWW\zadmin\config\swoole.php on line 9
PHP Warning:  Use of undefined constant SWOOLE_SOCK_TCP - assumed 'SWOOLE_SOCK_TCP' (this will throw an Error in a future version of PHP) in D:\phpstudy_pro\WWW\zadmin\config\swoole.php on line 10
PHP Fatal error:  Uncaught Error: Call to undefined function swoole_cpu_num() in D:\phpstudy_pro\WWW\zadmin\config\swoole.php:16
Stack trace:
#0 D:\phpstudy_pro\WWW\zadmin\vendor\topthink\framework\src\think\Config.php(92): include()
#1 D:\phpstudy_pro\WWW\zadmin\vendor\topthink\framework\src\think\Config.php(73): think\Config->parse('D:\\phpstudy_pro...', 'swoole')
#2 D:\phpstudy_pro\WWW\zadmin\vendor\topthink\framework\src\think\App.php(542): think\Config->load('D:\\phpstudy_pro...', 'swoole')
#3 D:\phpstudy_pro\WWW\zadmin\vendor\topthink\framework\src\think\App.php(451): think\App->load()
#4 D:\phpstudy_pro\WWW\zadmin\vendor\topthink\framework\src\think\Console.php(110): think\App->initialize()
#5 D:\phpstudy_pro\WWW\zadmin\vendor\topthink\framework\src\think\Console.php(94): think\Console->initialize()
#6 [internal function]: think\Console->__construct(Object(think\App))
#7 D:\phpstudy_pro\WWW\zadmin\vendor\topthink\framework\src\think\Container.php(394): ReflectionClass->newInstanceArgs(Array)
#8 D:\phpstudy_pro\WWW\zadmi in D:\phpstudy_pro\WWW\zadmin\config\swoole.php on line 16
Script @php think service:discover handling the post-autoload-dump event returned with error code 255
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值