hprose / hprose-swoole

Hprose asynchronous client & standalone server based on swoole
MIT License
181 stars 41 forks source link

Class 'swoole_http_client' not found i #13

Open chenxi2015 opened 4 years ago

chenxi2015 commented 4 years ago

Class 'swoole_http_client' not found in /Users/chenxi/web/service-backend-project/vendor/hprose/hprose-swoole/src/Hprose/Swoole/Http/Transporter.php:42

image 报如下错误: image

andot commented 4 years ago

这个版本是按照 swoole 1.8+ 来写的,可能最新的 swoole 已经不在支持当时的一些 API 了。以后升级到 hprose 3.0 的时候,会使用 swoole 4.4+ 来重写的。

chenxi2015 commented 4 years ago

哦哦 我现在用http/client方式调用rpc服务层 出现404 Not found错误 但是在YII2 框架下服务层是可以访问的 这是怎么回事啊?

chenxi2015 commented 4 years ago

刚才调试通了 为啥 hprose new client 一个地址 地址后面会默认加/ 比如: example.com/order 我测试了下 会变成 example.com/order/ 导致我严格的路由模式的话 会报错 就会404了

chenxi2015 commented 4 years ago

刚才调试通了 为啥 hprose new client 一个地址 地址后面会默认加/ 比如: example.com/order 我测试了下 会变成 example.com/order/ 导致我严格的路由模式的话 会报错 就会404了

希望能够解决

andot commented 4 years ago

代码里面并没有做把 example.com/order 变成 example.com/order/ 的处理啊。

chenxi2015 commented 4 years ago

代码里面并没有做把 example.com/order 变成 example.com/order/ 的处理啊。

但是 在我new client处理的时候 确实变成了 需要末尾加/ 才能返回数据 有点匪夷所思

andot commented 4 years ago

这不恰恰说明client没有自动加 '/' 吗?

yupaker commented 3 years ago

这个版本是按照 swoole 1.8+ 来写的,可能最新的 swoole 已经不在支持当时的一些 API 了。以后升级到 hprose 3.0 的时候,会使用 swoole 4.4+ 来重写的。

请问有没有开发3.0的计划

andot commented 3 years ago

有,但是现在在做go版本。