2019-06-24 13:10:41 +08:00
|
|
|
#!/usr/bin/env bash
|
2021-07-07 00:47:10 +08:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install libcurl4-openssl-dev
|
|
|
|
wget https://github.com/swoole/swoole-src/archive/${SW_VERSION}.tar.gz -O swoole.tar.gz
|
2019-06-24 13:10:41 +08:00
|
|
|
mkdir -p swoole
|
|
|
|
tar -xf swoole.tar.gz -C swoole --strip-components=1
|
|
|
|
rm swoole.tar.gz
|
|
|
|
cd swoole
|
|
|
|
phpize
|
2021-07-07 00:47:10 +08:00
|
|
|
./configure --enable-openssl --enable-http2 --enable-swoole-curl --enable-swoole-json
|
2019-06-24 13:10:41 +08:00
|
|
|
make -j$(nproc)
|
2020-10-27 23:36:09 +08:00
|
|
|
sudo make install
|
2021-07-07 00:47:10 +08:00
|
|
|
sudo sh -c "echo extension=swoole > /etc/php/${PHP_VERSION}/cli/conf.d/swoole.ini"
|
|
|
|
sudo sh -c "echo swoole.use_shortname='Off' >> /etc/php/${PHP_VERSION}/cli/conf.d/swoole.ini"
|
|
|
|
php --ri swoole
|