swoole 报错 SWOOLE_LIBRARY already defined


swoole bug

用swoole 的时候启动程序出现如下错误

PHP Notice: Constant SWOOLE_LIBRARY already defined in

PHP Fatal error: Cannot redeclare Swoole\Coroutine\batch() (previously declared in @swoole-src/library/core/Coroutine/functions.php:16)

解决办法

修改php ini
[swoole]
swoole.enable_library=off

swoole ini 配置

date.timezone = Asia/shanghai
swoole.enable_library = Off
swoole.use_shortname = On