yii2项目新增swoole

本文详细介绍了在虚拟机环境中安装Swoole PHP扩展的过程,包括下载、解压、编译及配置等步骤,并验证了安装成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

如何使用待续...

转载于:https://my.oschina.net/botkenni/blog/877592

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值