eventLoop has already been created. unable to create swoole_server

创建Server出现:

  1. PHP Fatal error: swoole_server::__construct(): eventLoop has already been created. unable to create swoole_server.

这表示你的程序在new swoole_server之前使用了其他异步IO的API,底层已经创建了EventLoop,无法重复创建。

这是错误的用法,如果要在Server中使用异步的ClientMySQLRedis,请在ServeronWorkerStart回调函数或其他发生在Worker进程内的回调函数中使用。