Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Swoole in ubuntu

Tags:

swoole

Simply my Question is How to Install Swoole in Ubuntu 14.04 LTS

I have tried

sudo pecl install swoole

am getting handfull of errors, already posted here

Is there any alternate way to install the same...

like image 451
Sumithran Avatar asked Dec 13 '22 14:12

Sumithran


2 Answers

Swoole Installation alternate ways

1.Install from source

sudo apt-get install php7-dev
git clone https://github.com/swoole/swoole-src.git
cd swoole-src
phpize
./configure
make && make install

2.Example for static compile

git clone -b PHP-7.2 --depth 1 https://github.com/php/php-src.git
cd php-src/
git clone -b master --depth 1 https://github.com/swoole/swoole-src.git ext/swoole
./buildconf --force
./configure --prefix=/usr/local/php7 --disable-all --enable-cli --disable-cgi --disable-fpm --disable-phpdbg --enable-bcmath --enable-hash --enable-json --enable-mbstring --enable-mbregex --enable-mbregex-backtrack --enable-sockets --enable-pdo --with-sodium --with-password-argon2 --with-sqlite3 --with-pdo-sqlite --with-pcre-regex --with-zlib --with-openssl-dir --enable-swoole-static --enable-openssl --with-swoole
time make -j `cat /proc/cpuinfo | grep processor | wc -l`
sudo make install
like image 74
Sumithran Avatar answered Jan 07 '23 23:01

Sumithran


Some Linux distributions do not include the PHP-XML extension in their PHP package and will need to be enabled before using PECL. You can install using apt-get install php-xml and you may need to install PHPize to compile Swoole, you can install it using apt-get install php7.*-dev or whatever PHP version you are using.

Then try again with sudo pecl install swoole

like image 40
Erdss4 Avatar answered Jan 07 '23 23:01

Erdss4