一行命令给 PHP 安装上 swoole 、phpy 扩展
From https://www.swoole.com:
curl -fsSL https://github.com/swoole/installers/blob/main/install.sh?raw=true | bash -s -- --latest --swoole-version=v5.1.3
From https://github.com/swoole/installers:
curl -fsSL https://github.com/swoole/installers/blob/main/install.sh?raw=true | bash -s -- --mirror china --latest
From https://gitee.com/jingjingxyk/swoole-install:
curl -fsSL https://gitee.com/jingjingxyk/swoole-install/raw/main/install.sh | bash -s -- --mirror china --latest
# 使用系统包管理工具安装 php
curl -fsSL https://gitee.com/jingjingxyk/swoole-install/raw/main/install.sh | bash -s -- --mirror china --latest --install-php
通过临时修改 $PATH 环境变量,例子:
export PATH=your-php-install-dir/bin/:$PATH
第一次用 sh 执行脚本 第二次用 bash 执行脚本
sh install.sh
bash install.sh| 操作系统 | 支持情况 | OS版本约束 |
|---|---|---|
| debian | ✅ | |
| ubuntu | ✅ | |
| rockylinux | ✅ | |
| almalinux | ✅ | |
| Alibaba cloud liunx | ✅ | |
| anolis | ✅ | |
| fedora | ✅ | |
| alpine | ✅ | |
| kali | ✅ | |
| macos | ✅ | |
| wsl | no test | |
| FreeBSD 13 | no test | |
| OpenEuler | ✅ | |
| Huawei Cloud EulerOS | ✅ | |
| archlinux | ✅ | |
| more helper | - | - |