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 Error: Call to undefined method swoole_http_response::gzip() #5

Closed
tanteng opened this issue Feb 7, 2018 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@tanteng
Copy link

tanteng commented Feb 7, 2018

[2018-02-07 14:54:30 *154.0] ERROR zm_deactivate_swoole (ERROR 503): Fatal error: Uncaught Error: Call to undefined method swoole_http_response::gzip() in /var/www/tanteng.me/vendor/hhxsv5/laravel-s/src/Swoole/DynamicResponse.php:13 Stack trace: #0 /var/www/tanteng.me/vendor/hhxsv5/laravel-s/src/Swoole/Response.php(54): Hhxsv5\LaravelS\Swoole\DynamicResponse->gzip() #1 /var/www/tanteng.me/vendor/hhxsv5/laravel-s/src/LaravelS.php(84): Hhxsv5\LaravelS\Swoole\Response->send(1) #2 /var/www/tanteng.me/vendor/hhxsv5/laravel-s/src/LaravelS.php(59) [2018-02-07 14:54:30 $113.0] WARNING swManager_check_exit_status: worker#0 abnormal exit, status=255, signal=0
安装了 ziplib 模块还是不行,环境 PHP7 + Swoole 最新版

@hhxsv5
Copy link
Owner

hhxsv5 commented Feb 7, 2018

执行下面的命令 确认zlib是否启用成功

php --ri swoole|grep zlib

如果成功应该输出"zlib => enabled"

@tanteng
Copy link
Author

tanteng commented Feb 7, 2018

php -m 有 zlib 模块
但是 php --ri swoole|grep zlib 没有输出

@hhxsv5
Copy link
Owner

hhxsv5 commented Feb 7, 2018

用ldconfig -p|grep libz确定下系统有没有libz
贴下系统版本,swoole版本。

@tanteng
Copy link
Author

tanteng commented Feb 7, 2018

确实没有 zlib 库,我使用的是 docker,在 dockerfile 加了安装命令,现在可以成功访问了。

RUN apt-get update && \ apt-get install -y libz-dev

@tanteng
Copy link
Author

tanteng commented Feb 7, 2018

另外还请教一个问题,使用 php artisan laravels start 启动了常驻进程后,需不需要配合 Supervisor 来监控

@hhxsv5
Copy link
Owner

hhxsv5 commented Feb 7, 2018

可以监管起来,不过Laravel需要非daemonize运行。

@RoderickKennedy
Copy link

RoderickKennedy commented Nov 14, 2019

| PHP | 7.3.9 |
| Swoole | 4.4.12 |
现在的版本已经启用gzip, 而是转向引用http_compression
https://wiki.swoole.com/wiki/page/973.html,
php --ri swoole|grep zlib 可民正常打印出相应的版本信息的,这个扩展默认也是安装有的,zlib => 1.2.7
这个代码应该要修改的,是个版本兼容问题

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

No branches or pull requests

3 participants