centos7 swoole安装

1.在php7.*安装好的前提,下载解压swoole

[root@localhost html]# wget http://pecl.php.net/get/swoole-4.2.10.tgz

[root@localhost html]# wget http://pecl.php.net/get/swoole-4.2.10.tgz

 

2.执行phpize

[root@localhost html]# cd swoole-4.2.10
[root@localhost swoole-4.2.10]# phpize
Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012

 

3.执行.configure

./configure && make clean && make && make install

 

4.修改配置文件php.ini 增加extension=swoole.so

  查找php.ini的位置

[root@localhost tcp]# php -i | grep php.ini
Configuration File (php.ini) Path => /usr/local/php/lib
Loaded Configuration File => /usr/local/php/lib/

  根据结果去找这个php.ini,结果不存在,于是去最初解压后php源码目录找到配置文件

[root@localhost ~]# ls
anaconda-ks.cfg  php-7.0.5  php-7.0.5.tar.gz
[root@localhost php-7.0.5]# ls | grep php.ini
php.ini-development
php.ini-production

  

[root@localhost php-7.0.5]# cp php.ini-development /usr/local/php/lib

 

5.重命名配置文件,打开增加extension=swoole.so

[root@localhost php-7.0.5]# cd /usr/local/php/lib
[root@localhost lib]# ls
php  php.ini

 

6.验证swoole安装是否成功

[root@localhost lib]# php -ir | grep swoole
swoole
swoole support => enabled
Author => Swoole Group[email: team@swoole.com]
swoole.aio_thread_num => 2 => 2
swoole.display_errors => On => On
swoole.enable_coroutine => On => On
swoole.fast_serialize => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608
swoole.use_shortname => On => On
看到这样的信息说明扩展安装成功
上一篇:Swoole入门到实战打造高性能赛事直播平台(完整版)


下一篇:swoole在优豆云虚拟主机的配置