Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Uncaught Swoole\Error: must be forked outside the coroutine #58

Open
xingxing55 opened this issue Mar 17, 2020 · 4 comments

Comments

@xingxing55
Copy link

执行php main.php -s start
提示:Fatal error: Uncaught Swoole\Error: must be forked outside the coroutine in Donkey-0.8/src/include/Process.class.php:21
Stack trace:
Donkey-0.8/src/include/Process.class.php(21): Swoole\Process->start()
Donkey-0.8/src/include/Crontab.class.php(216): Process->create_process('taskid1', Array)
Donkey-0.8/src/include/Crontab.class.php(185): Crontab::do_something(2)
#3 {main}
Donkey-0.8/src/include/Process.class.php on line 21

swoole 版本
swoole

Swoole => enabled
Author => Swoole Team [email protected]
Version => 4.4.16
Built => Feb 27 2020 14:45:23
coroutine => enabled
kqueue => enabled
rwlock => enabled
openssl => OpenSSL 1.0.2j 26 Sep 2016
pcre => enabled
zlib => 1.2.8
async_redis => enabled

Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 262144 => 262144

操作系统 macOS Sierra 10.12.6

后来我在Donkey-0.8/src/include/Crontab.class.php 注册定时任务register_timer() 添加 Swoole\Timer::set([
'enable_coroutine' => false,
]);
禁用协程,再次启动才能正常运行demo,请问是要禁用协程吗

@osgochina
Copy link
Owner

你好,这个项目是基于swoole的1.x开发的,使用的api在swoole协程版本中都不能用了。预计这个月底我会做一次更新,支持新版本的swoole

@xingxing55
Copy link
Author

好的谢谢

@mzwang07
Copy link

你好,这个项目是基于swoole的1.x开发的,使用的api在swoole协程版本中都不能用了。预计这个月底我会做一次更新,支持新版本的swoole

新版本swoole还准备支持么?

@osgochina
Copy link
Owner

osgochina commented Apr 13, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants