我的电脑环境,php7.4 + swoole 4.4.23 如果安装过程中有问题,请下面留言!! 加油干🤓
1,下载 git 下载地址: https://github.com/swoole/swoole-src/releases 下载命令:
wget https://github.com/swoole/swoole-src/archive/v4.4.23.tar.gz
3,解压
tar -zvxf v4.4.23.tar.gz
4,进入到解压过的目录
swoole-4.4.23
5, 输入你本地对应的php安装目录,例子:/xxx/xxx/phpize
/opt/homebrew/Cellar/php@7.4/7.4.27/bin/phpize
6,
./configure
7,
make && make install
8,
make test
这一步扩展已经安装成功 9,修改php.ini 配置添加(一定在重点强调,在配置文件末尾添加)
extension=swoole.so
10,测试安装结果
php --ri swoole
执行完展示以下就代表成功了
swoole
Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 4.4.23
Built => Feb 12 2022 21:54:33
coroutine => enabled
kqueue => enabled
rwlock => enabled
pcre => enabled
zlib => 1.2.11
async_redis => enabled
Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.enable_library => On => On
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 262144 => 262144
扩展安装结束,进入swoole 项目目录启动swoole即可
|