运行20天后,安装了event插件后,再启动gateway worker,出现了如下错误:
Worker process terminated with ERROR: E_ERROR "Uncaught Error: Class '\EventBase' not found in /www/php/GatewayWorker/vendor/workerman/workerman/Events/Event.php:65
Stack trace:
#0 /www/php/GatewayWorker/vendor/workerman/workerman/Worker.php(2286): Workerman\Events\Event->__construct()
#1 /www/php/GatewayWorker/vendor/workerman/gateway-worker/src/Gateway.php(276): Workerman\Worker->run()
#2 /www/php/GatewayWorker/vendor/workerman/workerman/Worker.php(1452): GatewayWorker\Gateway->run()
#3 /www/php/GatewayWorker/vendor/workerman/workerman/Worker.php(1282): Workerman\Worker::forkOneWorkerForLinux(Object(GatewayWorker\Gateway))
#4 /www/php/GatewayWorker/vendor/workerman/workerman/Worker.php(1256): Workerman\Worker::forkWorkersForLinux()
#5 /www/php/GatewayWorker/vendor/workerman/workerman/Worker.php(1586): Workerman\Worker::forkWorkers()
#6 /www/php/GatewayWorker/vendor/workerman/workerman/Worker.php(1535): Workerman\Worker::monitorWorkersForLinux()
#7 /www/php/GatewayWorker/vendor/workerman/workerman/Worker.php(509): Workerman\Worker::monitorWorkers()
#8 /w in /www/php/GatewayWorker/vendor/workerman/workerman/Events/Event.php on line 65"
Workerman stopping ...
worker exit with status 65280
worker exit with status 65280
worker exit with status 65280
worker exit with status 65280
worker exit with status 65280
worker exit with status 65280
Workerman has been stopped
可能的原因:
1. 安装了event扩展之后,PHP却没有激活event, 检测命令: /path/to/php -m | grep -i event
2. event 扩展自身有bug或者PHP版本等的BUG, 检查你下你的workerman版本、PHP版本以及扩展版本的对应情况。
检查一下有没有装php-pecl-event