swoft框架需要的扩展安装

phpiredis异步redis

swoole 扩展

先安装php7.2
apt install php7.2-fpm php7.2-mysql php7.2-curl php7.2-gd php7.2-mbstring php7.2-xml php7.2-xmlrpc php7.2-zip php7.2-opcache -y

安装http2
wget https://github.com/nghttp2/nghttp2/releases/download/v1.30.0/nghttp2-1.30.0.tar.bz2
tar -jxvf nghttp2-1.30.0.tar.bz2
cd nghttp2-1.30.0/
./configure 
make
make install

安装异步redis
git clone https://github.com/nrk/phpiredis.git
cd phpiredis/
/usr/bin/phpize7.2 
./configure --enable-phpiredis
make
make install

sudo vim /etc/php/7.2/mods-available/phpiredis.ini添加extension=phpiredis.so
sudo ln -s /etc/php/7.2/mods-available/phpiredis.ini /etc/php/7.2/cli/conf.d/20-phpiredis.ini
sudo ln -s /etc/php/7.2/mods-available/phpiredis.ini /etc/php/7.2/fpm/conf.d/20-phpiredis.ini
重启php

安装swoole
wget https://github.com/swoole/swoole-src/archive/v2.1.3.tar.gz
tar -zxvf v2.1.3.tar.gz 
cd swoole-src-2.1.3/

/usr/bin/phpize7.2 
./configure --enable-async-redis --enable-mysqlnd --enable-coroutine --enable-openssl --enable-http2
make
make install

sudo vim /etc/php/7.2/mods-available/swoole.ini添加extension=swoole.so
sudo ln -s /etc/php/7.2/mods-available/swoole.ini /etc/php/7.2/cli/conf.d/20-swoole.ini
sudo ln -s /etc/php/7.2/mods-available/swoole.ini /etc/php/7.2/fpm/conf.d/20-swoole.ini
重启php

php -m | grep swoole
php --ri swoole
看到如下结果标识正确:
swoole

swoole support => enabled
Version => 2.1.3
Author => tianfeng.han[email: mikan.tenny@gmail.com]
coroutine => enabled
epoll => enabled
eventfd => enabled
timerfd => enabled
signalfd => enabled
cpu affinity => enabled
spinlock => enabled
rwlock => enabled
async redis client => enabled
async http/websocket client => enabled
openssl => enabled
http2 => enabled
Linux Native AIO => enabled
pcre => enabled
zlib => enabled
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
mysqlnd => enabled

Directive => Local Value => Master Value
swoole.aio_thread_num => 2 => 2
swoole.display_errors => On => On
swoole.use_namespace => On => On
swoole.use_shortname => On => On
swoole.fast_serialize => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值