php8.1安装swoole
wget https://github.com/swoole/swoole-src/archive/refs/tags/v4.8.12.tar.gz tar -xzvf v4.8.12.tar.gz cd swoole-src-4.8.12/ /usr/local/php81/bin/phpize && ./configure --with-php-config=/usr/local/php81/bin/php-config make && make install # 如果是新安装的php安装之后没有php.ini需要从安装包找到php.ini复制到安装目录 find / -name "php.ini*" cp /opt/php-8.1.11/php.ini-production /usr/local/php81/etc/php.ini
# 已经安装的有php.ini直接编辑就好 vim /usr/local/php81/etc/php.ini # 底部添加 extension=swoole.so # 重启 # 查看扩展 /usr/local/php81/sbin/php-fpm -m