How to install Swoole in ubuntu
Asked Answered
C

4

5

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...

Childbed answered 21/9, 2018 at 9:52 Comment(0)
C
6

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
Childbed answered 21/9, 2018 at 9:52 Comment(1)
Sometimes you need to run "make clean" before all steps.Nahshu
S
6

For those who installed PHP from ondrej/php PPA (quite common way to install PHP in Ubuntu) it's quite easy now:

sudo apt install php-swoole

Or for specific version:

sudo apt install php7.4-swoole

Tip. This is how you usually install ondrej/php PPA:

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
Sufficient answered 15/7, 2021 at 13:1 Comment(0)
P
5

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

Palmar answered 24/9, 2018 at 11:3 Comment(0)
F
2

Install swoole for version specific should work for example if you have php 7.3 use

sudo apt install php7.3-swoole

replace the version to your local php env

Frogman answered 27/12, 2021 at 3:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.