SWOOLE Installation and Configuration
shiktocf
Latest version : pecl install openswoole - 4.11 . 1
Note: Please make sure you have followed the requirements guide before attempting to install Open Swoole, this ensures you have a latest system and all the required packages and full third party libraries.
Here are installation instructions for different platforms:
Docker
Install via Open Swoole Docker
docker pull openswoole / swoole
Linux Systems
Installing via Open Swoole Ubuntu PPA
You can install the Open Swoole binary release via the official Open Swoole Ubuntu PPA . For example, on Ubuntu or Debian:
Install Open Swoole on Ubuntu 20.04 LTS (Focal Fossa)
apt updateapt install - y software - properties - common && add - apt - repository ppa : ondrej / php - yapt install - y software - properties - common && add - apt - repository ppa : openswoole / ppa - y # choose one PHP version: #apt install -y php7.4-openswoole #apt install -y php8.0-openswoole apt install - y php8 . 1 - openswoole
Install Open Swoole on Ubuntu 22.04 LTS (Jammy Jellyfish)
apt updateapt install - y software - properties - common && add - apt - repository ppa : openswoole / ppa - y # choose one PHP version: #apt install -y php7.4-openswoole #apt install -y php8.0-openswoole apt install - y php8 . 1 - openswoole
Install Open Swoole on CentOS
You can install the Open Swoole binary release via Remi's RPM repository .
Install Remin Rpo on RHEL CentOS, Fedora
Install Epel and Remi Repo in RHEL:
# On RHEL/CentOS 8 yum install http : //rpms.remirepo.net/enterprise/remi-release-8.rpmyum updateyum -- enablerepo = remi install package#On RHEL/CentOS 7 yum install http : //rpms.remirepo.net/enterprise/remi-release-7.rpmyum updateyum -- enablerepo = remi install package
Install Remi Repo in Fedora:
dnf install http : //rpms.remirepo.net/fedora/remi-release-35.rpm #[On Fedora 34] dnf install http : //rpms.remirepo.net/fedora/remi-release-34.rpm #[ On Fedora 34] dnf install http : //rpms.remirepo.net/fedora/remi-release-33.rpm #[On Fedora 33] dnf install http : //rpms.remirepo.net/fedora/remi-release-32.rpm #[On Fedora 32] yum -- enablerepo = remi install package
Install Open Swoole on RHEL CentOS, Fedora
# choose one PHP version: #yum install php74-php-openswoole #yum install php80-php-openswoole yum install php81 - php - openswoole
Installing via PHP PECL
Open Swoole is released as a PECL package and can be installed from the binary using the command line. This is the easiest and fastest way to work with Open Swoole.
#!/bin/bash# Make sure PECL is available... $ sudo apt install php - dev# Latest release of Open Swoole via PECL $ sudo pecl install openswoole
Or to install a specific version using PECL:
#!/bin/bash $ sudo pecl install openswoole - 4.9 . 1
Windows
Install Open Swoole on Windows
You should use Ubuntu on WSL to use Open Swoole on Windows.
You must be running Windows 10 version 2004 or later (Build 19041 or later) or Windows 11.
wsl --install
Install Open Swoole on WSL / WSL2 (Ubuntu)
apt updateapt install - y software - properties - common && add - apt - repository ppa : ondrej / php - yapt install - y software - properties - common && add - apt - repository ppa : openswoole / ppa - y # choose one PHP version: #apt install -y php7.4-openswoole #apt install -y php8.0-openswoole apt install - y php8 . 1 - openswoole
PECL Configuration Options for Open Swoole
When installing Open Swoole via PECL, during the installation it will ask you if you want to enable certain features, this can be provided before running the installation, this helps automate the installation of Swoole or when you don't want to install it. to stop and wait for input. Some options require third party libraries to be installed, see prerequisites.
Shorthand Configure Flag
#!/bin/bash$ pecl install -D 'enable-sockets="no" enable-openssl="yes" enable-http2="yes" enable-mysqlnd="yes" enable-swoole-json="no" enable-swoole-curl="yes" enable-cares="yes" with-postgres="yes"' openswoole
Longhand Configure Flag
#!/bin/bash $ pecl install -- configureoptions 'enable-sockets="no" enable-openssl="yes" enable-http2="yes" enable-mysqlnd="yes" enable-swoole-json="no" enable-swoole-curl="yes"enable-cares="yes" with-postgres="yes"' openswoole
Note:Open Swoole PECL releases are later than GitHub releases.
MacOS Systems
Install Open Swoole with Brew and PECL
#!/bin/bash# If you haven't got PHP installed$ brew install php$ pecl install openswoole
Install Open Swoole with MacPorts
sudo port install php - openswoole
Building Open Swoole from source
Make sure you have completed the prerequisites before compiling Swoole.
To compile and install the Swoole extension for PHP, we can clone the repository from GitHub where Swoole is developed, check out the version you want to compile and install it manually.
Download the source package from GitHub Releases or clone from the git repository.
#!/bin/bash# Install git to access the source code from GitHub$ sudo apt install git$ cd /tmp && git clone https://github.com/openswoole/swoole-src.git && \ cd swoole-src && \ git checkout v4.9.1 && \ phpize && \ ./configure --enable-openssl \ --enable-mysqlnd \ --enable-sockets \ --enable-http2 \ --enable-swoole-curl \ --enable-swoole-json \ --with-postgres \ --enable-cares && \ sudo make && sudo make install
Enable Open Swoole extension in PHP
Enjoying the article?
Create a free account to unlock unlimited access to all articles, bookmark your favorites, and join our growing community of readers.
You might also like
What is a standard SEO website? 30 criteria for evaluating a standard SEO, quality website
11 ways to increase website traffic safely and effectively
What is bounce rate? How much is good and how to optimize bounce rate effectively
What is photo geotagging? How to optimize and geotag photos effectively and professionally
shiktocf
Want to Share Your Knowledge?
Join our community of writers and help others learn from your experience. Start writing today.
Get StartedUnique Company Logo for Website
Professional Logo Design for Your Website or CompanyWelcome to the premier logo...
Optimize BigCommerce Site Speed
Expert BigCommerce Website Speed OptimizationWith extensive experience in enha...
Install WordPress Theme Matching Demo Exact
Need Your Premium WordPress Theme Set Up Like the Demo Site?If you’ve bought a...
Get a Monetizable & Fantastic WordPress Arcade Site
Obtain a Stunning & Profitable WordPress Arcade Games WebsiteReceive an Instan...
Design Stunning WordPress Website for Your Business
Create a Stunning WordPress Website for Your BusinessHello! I’m Stephen, your...
Create Premium Shopify & WordPress Websites Easily
Welcome to Sofikulweb, your go-to expert for premium Shopify and WordPress websi...
Build WooCommerce Store & Get 3 Days Free Support
Looking to launch an online eCommerce store or expand your current business? You...
Professional WordPress Website Design & Fix
I specialize in crafting, fixing, and building WordPress websites with expertise...
Latest Articles
Optimize the speed of your Laravel application
3 weeks ago • rakiburdma
Open Swoole – An extremely fast PHP asynchronous processing framework
3 weeks ago • shiktocf
What is Heading? Tips to SEO-optimize effective Heading for beginners 2025
4 weeks ago • iBial Team
Onpage SEO 2025? 26 Onpage SEO optimization criteria from basic to advanced
4 weeks ago • iBial Team
What is organic traffic? Reasons and ways to invest in organic traffic effectively
4 weeks ago • pial