2019-04-29sad creeper
swoole只能用在Linux上
我用官方给的pecl安装
pecl install swoole
安装指定版本的:
pecl install https://pecl.php.net/get/swoole-1.9.23.tgz
报错:-bash: pecl: command not found
解决:yum install php-devel php-pear
报错:No releases available for package "pecl.php.net/swoole"
解决:
pear clear-cache
pear update-channels
pear upgrade
删掉禁用的函数oppend(),readlink()等
安装中的插件自己看情况选择默认NO
// 是否启用 Debug 跟踪调试
// 启用后,会在命令行中输出 Debug 跟踪 log,我一般禁用此项。
enable debug/trace log support? [no] : no
// 是否启用 PHP Sockets 支持
// 如果你需要用 PHP 编写 Sockets 服务,可以启用此项。
enable sockets supports? [no] : yes
// 是否启用 OpenSSL 支持
// 是否启用 SSL 加密,如果你是通过 Swoole 提供对外的 HTTPS 服务,则需要启用此项。
// 我的 Mac 是本地开发用,所以不启用。
enable openssl support? [no] : no
// 是否启用 HTTP2 支持
// 了解 HTTP2 新特性 https://zh.wikipedia.org/wiki/HTTP/2
enable http2 support? [no] : yes
// 是否启用异步 Redis 支持
// Swoole 实现了一套支持异步的 Redis 服务端框架
// https://wiki.swoole.com/wiki/page/p-redis_server.html
enable async-redis support? [no] : yes
// 是否启用 MySQL 原生支持
enable mysqlnd support? [no] : yes
// 是否启用 PgSQL 协程客户端支持
enable postgresql coroutine client support? [no] : yes
注意:ssl的时候是否开启了openssl
升级swoole一定要重启php-fmp
/etc/init.d/php-fpm restart
查看版本
php --ri swoole
阅读 910 评论