准备
- 确认机器上安装了
php
, phpize
, make
- 到 swoole 官网发布页面,下载最新稳定版 release 包
开工
$ tar xf swoole.tar.gz
$ cd swoole
$ ./configure
$ make -j6
$ make install
修改 PHP 配置项,开启
swoole.so
扩展
php --ini
获取配置文件信息
检测
$ php --ri swoole
# 样例输出
swoole
Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 4.4.7
Built => Sep 29 2019 16:10:02
coroutine => enabled
kqueue => enabled
rwlock => enabled
http2 => enabled
pcre => enabled
zlib => enabled
brotli => enabled
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