Swoole
编译安装
1、下载源码
[root@local ~]# cd /home/
[root@local ~]# wget https://pecl.php.net/get/swoole-4.8.8.tgz
2、解压
[root@local ~]# tar -zxvf swoole-4.8.8.tgz
[root@local ~]# cd swoole-4.8.8
[root@local ~]# phpize
[root@local ~]# ./configure --with-php-config=/www/server/php8/bin/php-config --enable-openssl --enable-http2
[root@local ~]# make
[root@local ~]# make install
3、配置php.ini
注意:不知道 php.ini 所在目录时,您可以通过运行 php --ini
确定。
php --ini
// Configuration File (php.ini) Path: /usr/local/php8/etc
// Loaded Configuration File: /usr/local/php8/etc/php.ini
编译安装成功后,修改php.ini加入
extension=swoole.so
4、查看swoole版本
[root@local ~]# php --ri swoole
swoole
Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 4.8.8
Built => Jan 23 2021 18:16:30
coroutine => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
openssl => OpenSSL 1.0.2k-fips 26 Jan 2022
http2 => enabled
pcre => enabled
zlib => 1.2.7
mutex_timedlock => enabled
pthread_barrier => enabled
futex => 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 => 8388608 => 8388608