準備
- 確認機器上安裝了
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