centos7 安装swoole 4

swoole 官方安装 https://wiki.swoole.com/#/environment

ubuntu 没有安装 phpize 可执行命令:sudo apt-get install php-dev 来安装 phpize

安装过程
0.下载swoole git clone https://github.com/swoole/swoole-src.git
1. cd swoole-src

  #下载 https://github.com/swoole/swoole-src/releases


 # tar zxvf swoole-4.0.4

2. /use/local/php/bin/phpize  #这里要制定绝对路径,

有些人直接使用phpize,会有 

Cannot find config.m4. 
Make sure that you run '/usr/local/php/bin/phpize' in the top level source directory of the module

使用绝对路径就没这种情况了

3.
.
/configure --with-php-config=/usr/local/bin/php-config #这里要制定绝对路径 4. make && sudo make install 编译安装到系统成功后,需要在 php.ini 中加入一行 extension=swoole.so 来启用 Swoole 扩展 php --ri swoole 可以看到info,说么成功了,ubnutu 自带php ,如果有又不想使用,那么自行使用绝对路径 /use/local/php/bin/php --ri swoole

 

##重新编译安装

1 /use/local/php/bin/phpize 

2 ./configure --enable-openssl --with-php-config=/www/server/php/74/bin/php-config

3.

make clean #这一步很重要,少了可能失败
make && make install

 4.php --ri swoole

swoole

Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 4.5.9
Built => Dec 6 2020 20:46:59
coroutine => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
openssl => OpenSSL 1.0.2k-fips 26 Jan 2017
pcre => enabled
zlib => 1.2.7
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
async_redis => enabled

posted @ 2020-04-04 20:49  freedom/cn  阅读(392)  评论(0编辑  收藏  举报