安装PHP-swoole

2018-11-26  本文已影响0人  胡乱唱歌ing

安装hiredis

说明:避免使用redis连接池是出现PHP Fatal error: Uncaught Error: Class ‘swoole_redis’ not found in **********

hiredis下载地址:https://github.com/redis/hiredis/releases

进入源码目录后执行以下命令

make -j

sudo make install

sudo ldconfig 如果是mac 这句换成 sudo update_dyld_shared_cache

执行以下两条命令

C_INCLUDE_PATH=/usr/local/include/ export C_INCLUDE_PATH

LIBRARY_PATH=/usr/local/lib/ export LIBRARY_PATH

安装swoole

wget https://github.com/swoole/swoole-src/archive/v4.2.8.tar.gz

cd  swoole-src-4.2.8

sudo phpize (ubuntu没有安装phpize可执行命令:sudo apt-getinstall php-dev来安装phpize)

sudo ./configure --enable-async-redis

sudo make && make install

php.ini 添加swoole.so 

extension=swoole.so的路径

检查是否安装成功

php -m | grep swoole

上一篇下一篇

猜你喜欢

热点阅读