之前安装了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

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

1692

被折叠的 条评论
为什么被折叠?



