1、在虚拟机的个人根目录上执行下面代码,下载swoole扩展插件(cd ~)
wget https://github.com/swoole/swoole-src/archive/v1.9.8.zip
2、解压缩文件,如没有unzip工具,则需要下载(yum -y install unzip)
unzip v1.9.8.zip
3、压缩完之后进入到文件目录
cd swoole-src-1.9.8/
4、执行
phpize
5、执行
./configure
6、执行
make
7、执行
make install
8、配置php.ini文件,搜索/extension=,加入extension=swoole.so扩展开启
vim /etc/php.ini
extension=swoole.so
9、重启
systemctl restart php-fpm
10、查看是否已经安装完毕
php -i |grep swoole
[root@develop swoole-src-1.9.8]# php -i |grep swoole
PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
swoole
swoole support => enabled
swoole.aio_thread_num => 2 => 2
swoole.display_errors => On => On
swoole.fast_serialize => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608
swoole.use_namespace => Off => Off
PWD => /root/swoole-src-1.9.8
_SERVER["PWD"] => /root/swoole-src-1.9.8
如何使用待续...