首页
下载
文档
社区
视频
捐赠
源代码
赞助商
AOT 编译器
AI 助理
商业产品
PHP AOT 原生编译器
Swoole-Compiler 代码加密器
CRMEB 新零售社交电商系统
登录
注册
全部
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
发表新帖
开启enableCoroutine发送https请求会报错abnormal exit, status=0, signal=10
### 问题描述 我想用协程发送多个https请求、结果报错http没有问题  ### Swoole版本,PHP版本,以及操作系统版本信息 swoole 4.8.x 版本  操作系统 MacOS 12.4 芯片m1 max ### 相关代码 ```php $http = new Swoole\Http\Server('127.0.0.1', 9501); Swoole\Runtime::enableCoroutine(); $http->on('start', function ($server) { echo "Swoole http server is started at http://127.0.0.1:9501\n"; }); $http->on('request', function ($request, $response) { $response->header('Content-Type', 'text/plain'); // $a=file_get_contents("http://www.baidu.com"); // var_dump($a); $b = file_get_contents("https://www.baidu.com"); var_dump($b); $response->end('Hello World'); }); $http->start(); ``` 去掉Swoole\Runtime::enableCoroutine();就没有问题 或者使用http请求也没有问题、刚开始以为框架问题后来不是 ### 你期待的结果是什么?实际看到的错误信息又是什么? 不知道是不是bug、如果不是bug我该如何正确的使用
发布于4年前 · 20 次浏览 · 来自
提问
石窝
### 问题描述 我想用协程发送多个https请求、结果报错http没有问题  ### Swoole版本,PHP版本,以及操作系统版本信息 swoole 4.8.x 版本  操作系统 MacOS 12.4 芯片m1 max ### 相关代码 ```php $http = new Swoole\Http\Server('127.0.0.1', 9501); Swoole\Runtime::enableCoroutine(); $http->on('start', function ($server) { echo "Swoole http server is started at http://127.0.0.1:9501\n"; }); $http->on('request', function ($request, $response) { $response->header('Content-Type', 'text/plain'); // $a=file_get_contents("http://www.baidu.com"); // var_dump($a); $b = file_get_contents("https://www.baidu.com"); var_dump($b); $response->end('Hello World'); }); $http->start(); ``` 去掉Swoole\Runtime::enableCoroutine();就没有问题 或者使用http请求也没有问题、刚开始以为框架问题后来不是 ### 你期待的结果是什么?实际看到的错误信息又是什么? 不知道是不是bug、如果不是bug我该如何正确的使用
赞
0
收藏
提问
分享
讨论
建议
公告
开发框架
CodeGalaxy
登录
后参与评论
评论
2022-06-30
Rango
感谢你的反馈,我们尽快在 m1 平台上测试一下。
赞
0
回复
2022-09-02
石窝
回复
Rango
还是没有解决这个问题、我在最新版本的4.8.11测试了,这个 开启`enableCoroutine`发送https请求会报错`abnormal exit, status=0, signal=10` 我的编译参数是 ``` ./configure --enable-http2 --enable-thread-context --enable-http2 --enable-mysqlnd --enable-openssl --with-openssl-dir=/opt/homebrew/Cellar/openssl@3/3.0.0_1 --enable-sockets --enable-swoole-json --enable-swoole-curl ``` 现在的版本是不是需要用这个`enableCoroutine`代码了
赞
0
回复