Linux 编译安装swoole

Linux 编译安装swoole

1.下载 解压

[root@lar ~]# cd /usr/local/swoole
[root@lar swoole]# cd /usr/local/swoole
[root@lar swoole]# wget https://github.com/swoole/swoole-src/archive/master.zip -O swoole-src-master.zip
[root@lar swoole]# unzip swoole-src-master.zip

2.编译安装

[root@lar swoole]# cd swoole-src-master/
[root@lar swoole-src-master]# phpize
[root@lar swoole-src-master]# ./configure --with-php-config=/usr/local/php/bin/php-config 
[root@lar swoole-src-master]# make
[root@lar swoole-src-master]# make install

3.添加扩展

[root@lar swoole-src-master]# vim /usr/local/php/etc/php.ini

添加一行

extension=swoole.so;

4.查看是否添加成功

[root@lar swoole]# php -m | grep  swoole
swoole

此时已安装成功
5.查看swoole版本信息

[root@lar swoole]# php --ri swoole

swoole

Swoole => enabled
Author => Swoole Team <[email protected]>
Version => 4.4.0-alpha
Built => May 13 2019 15:05:53
coroutine => enabled
debug => enabled
trace_log => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
http2 => enabled
pcre => enabled
zlib => enabled
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
async_redis => enabled

Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 8388608 => 8388608

猜你喜欢

转载自blog.csdn.net/weixin_41665382/article/details/90174607