2019-06-24 13:10:41 +08:00
|
|
|
#!/usr/bin/env bash
|
2023-06-07 13:05:40 +08:00
|
|
|
|
|
|
|
php -m | grep -i swoole
|
|
|
|
|
|
|
|
if [ $? -eq 1 ]; then
|
|
|
|
|
|
|
|
sudo apt-get clean
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get upgrade -f
|
|
|
|
sudo apt-get install libcurl4-openssl-dev libc-ares-dev libpq-dev
|
|
|
|
wget https://github.com/swoole/swoole-src/archive/${SW_VERSION}.tar.gz -O swoole.tar.gz
|
|
|
|
mkdir -p swoole
|
|
|
|
tar -xf swoole.tar.gz -C swoole --strip-components=1
|
|
|
|
rm swoole.tar.gz
|
|
|
|
cd swoole
|
|
|
|
phpize
|
|
|
|
./configure --enable-openssl --enable-swoole-curl --enable-cares --enable-swoole-pgsql --enable-brotli
|
|
|
|
make -j$(nproc)
|
|
|
|
sudo make install
|
2023-11-28 09:14:26 +08:00
|
|
|
sudo sh -c "echo extension=swoole > /etc/php/${PHP_VERSION}/cli/conf.d/swoole.ini"
|
2023-06-07 13:05:40 +08:00
|
|
|
|
|
|
|
fi
|
|
|
|
|
2021-07-07 00:47:10 +08:00
|
|
|
sudo sh -c "echo swoole.use_shortname='Off' >> /etc/php/${PHP_VERSION}/cli/conf.d/swoole.ini"
|