PHPackages                             openswoole/ext-openswoole - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. openswoole/ext-openswoole

ActivePhp-ext[Framework](/categories/framework)

openswoole/ext-openswoole
=========================

High Performance Programmatic Server for PHP with Async IO, Coroutines and Fibers

8561754[44 issues](https://github.com/openswoole/ext-openswoole/issues)[2 PRs](https://github.com/openswoole/ext-openswoole/pulls)C++CI passing

Since Mar 17Pushed 3mo ago18 watchersCompare

[ Source](https://github.com/openswoole/ext-openswoole)[ Packagist](https://packagist.org/packages/openswoole/ext-openswoole)[ RSS](/packages/openswoole-ext-openswoole/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)DependenciesVersions (1)Used By (0)

[![](https://camo.githubusercontent.com/3ccc7f3cac008a7d71c0b39c5b36b7afa1a154a275e8643182ca052c93f76a51/68747470733a2f2f6f70656e73776f6f6c652e636f6d2f696d616765732f73776f6f6c652d6c6f676f2e7376672367682d6c696768742d6d6f64652d6f6e6c79)](https://openswoole.com)

[![ext-openswoole](https://github.com/openswoole/ext-openswoole/workflows/ext-openswoole/badge.svg)](https://github.com/openswoole/ext-openswoole/actions?query=workflow%3Aext-openswoole)[![test-linux](https://github.com/openswoole/ext-openswoole/workflows/test-linux/badge.svg)](https://github.com/openswoole/ext-openswoole/actions?query=workflow%3Atest-linux)

OpenSwoole
----------

[](#openswoole)

OpenSwoole is a programmatic server for PHP with async IO, coroutines and fibers: secure, reliable, high performance

- **Website**:
- **Twitter**:
- **Slack**:
- **Discord**:
- **IDE Helper**:

Documentation
-------------

[](#documentation)

Documentation for OpenSwoole can be found on the [OpenSwoole website](https://openswoole.com/docs).

Installation
------------

[](#installation)

> OpenSwoole always provides the most reliable stability and the most powerful features in **the latest released version**. Please ensure as much as possible that you are using the latest version.

### 1. Install via PIE (PHP Installer for Extensions)

[](#1-install-via-pie-php-installer-for-extensions)

[PIE](https://github.com/php/pie) is the modern way to install PHP extensions. Requires PHP 8.1+ to run.

```
pie install openswoole/ext-openswoole
```

With optional configure flags:

```
pie install openswoole/ext-openswoole \
  --enable-openssl \
  --enable-sockets \
  --enable-http2 \
  --enable-hook-curl
```

### 2. Install or upgrade OpenSwoole from multiple distribution channels

[](#2-install-or-upgrade-openswoole-from-multiple-distribution-channels)

Please check [OpenSwoole Installation Guide](https://openswoole.com/docs/get-started/installation) about how to install OpenSwoole on Ubuntu/CentOS/Windows WSL from Docker, PECL or Binary releases channels.

### 3. Compile from source

[](#3-compile-from-source)

#### Compiling requirements

[](#compiling-requirements)

- Linux, OS X or Cygwin, WSL
- PHP 8.3.0 or later (The higher the version, the better the performance.)
- GCC 4.8 or later

Download the source packages from [Releases](https://github.com/openswoole/ext-openswoole/releases) or:

```
git clone https://github.com/openswoole/ext-openswoole.git && \
cd ext-openswoole
git checkout v26.2.0
phpize && \
./configure && \
make && make install
```

You can find how to fix [Common Installation Errors](https://openswoole.com/docs/get-started/common-install-errors) if there are errors in the installation.

#### Compile configurations

[](#compile-configurations)

> for example: `./configure --enable-openssl --enable-sockets`

- `--enable-openssl` or `--with-openssl-dir=DIR`
- `--enable-sockets`
- `--enable-http2`
- `--enable-mysqlnd` (need mysqlnd, it just for supporting `$mysql->escape` method)
- `--enable-hook-curl`
- `--with-postgres[=DIR]`

#### Enable OpenSwoole extension

[](#enable-openswoole-extension)

After compiling and installing the openswoole extension, you have to add a new line `extension=openswoole.so` at the end of `php.ini` or create a ini file at `conf.d` folder to enable OpenSwoole. It is recommended to be added after all the other extensions because openswoole may depend on extensions: sockets, mysqlnd, curl etc.

Examples
--------

[](#examples)

Learn OpenSwoole by exploring the examples:

Fiber Context and Xdebug Support
--------------------------------

[](#fiber-context-and-xdebug-support)

OpenSwoole supports using PHP's native Fiber API as the coroutine context backend. This enables compatibility with debugging and profiling tools like Xdebug that rely on PHP's fiber infrastructure to trace execution across coroutines.

### Enable PHP's Fiber Context

[](#enable-phps-fiber-context)

Add the following INI setting to your `php.ini`:

```
openswoole.use_fiber_context=On
```

Or enable in your code:

```
Co::set(['use_fiber_context' => true]);
```

When enabled, OpenSwoole uses PHP fibers internally to switch between coroutines instead of the default boost ASM context. This allows tools like Xdebug to properly trace and debug coroutine execution, including step debugging, stack traces, and profiling across coroutine boundaries.

### Using Xdebug with OpenSwoole

[](#using-xdebug-with-openswoole)

1. Install and enable both the `xdebug` and `openswoole` extensions in your `php.ini`:

```
zend_extension=xdebug.so
extension=openswoole.so
openswoole.use_fiber_context=On
```

2. Configure Xdebug as usual (e.g. for step debugging):

```
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_host=127.0.0.1
xdebug.client_port=9003
```

3. Run your OpenSwoole application and connect your IDE debugger. Xdebug will be able to trace execution across coroutine switches.

> **Note:** Fiber context mode requires PHP 8.3 or later. There is a minor performance overhead compared to the default ASM context, so it is recommended to use this mode only during development and debugging.

4. Xdebug trace log example:

```
php -d xdebug.mode=trace \
  -d xdebug.start_with_request=yes \
  -d xdebug.output_dir=/tmp \
  -d xdebug.trace_output_name=openswoole_trace \
  -d xdebug.trace_format=0 \
  -d xdebug.collect_return=1 \
  -d xdebug.use_compression=false \
  examples/helloworld.php

tail -f /tmp/openswoole_trace.xt
```

Reactor Settings
----------------

[](#reactor-settings)

OpenSwoole uses an event-driven reactor for non-blocking I/O. The reactor type can be configured globally via `Co::set()`:

```
Co::set(['reactor_type' => OPENSWOOLE_IO_URING]);
```

### Available Reactor Types

[](#available-reactor-types)

ConstantPlatformDescription`OPENSWOOLE_SELECT`All`select()` system call, portable but limited scalability`OPENSWOOLE_POLL`Linux, macOS`poll()` system call, no fd limit like select`OPENSWOOLE_EPOLL`Linux`epoll`, high performance for large numbers of connections`OPENSWOOLE_KQUEUE`macOS, BSD`kqueue`, high performance on BSD-based systems`OPENSWOOLE_IO_URING`Linux 5.1+`io_uring`, highest performance with async I/O supportBy default, OpenSwoole automatically selects the best available reactor for your platform (`epoll` on Linux, `kqueue` on macOS).

### Server Reactor Threads

[](#server-reactor-threads)

For `OpenSwoole\Server`, the number of reactor threads can be configured:

```
$server = new OpenSwoole\Server('0.0.0.0', 9501);
$server->set([
    'reactor_num' => 4, // defaults to number of CPU cores
]);
```

Frameworks &amp; Components
---------------------------

[](#frameworks--components)

> PR are welcome if your framework is using openswoole

- [**Laravel Octane**](https://laravel.com/docs/9.x/octane) Laravel Octane supercharges your application's performance by serving your application using high-powered application servers.
- [**PHP Runtime**](https://github.com/php-runtime) make it easy to run any kind of PHP Application (Symfony, Laravel, PSR7, Native) with all kinds of Runtimes like OpenSwoole, Bref, Google Cloud Functions, Roadrunner and React PHP with minimal configuration.
- [**Mezzio Swoole**](https://docs.mezzio.dev/mezzio-swoole/) allows you to run Mezzio and [PSR-15](https://www.php-fig.org/psr/psr-15/) applications on OpenSwoole.

For Contributors
----------------

[](#for-contributors)

If you like to involve the maintenance of this repo, it is better to get started by submitting PR, you will be invited to the dev group once there are significant contributions. Or join Slack group firstly, the team will provide mentoring and internal support to help you get started.

- [Report issues and feedback](https://github.com/openswoole/ext-openswoole/issues)
- Submit fixes, features via Pull Request

This project exists thanks to all the historical \[[Contributors](https://github.com/openswoole/ext-openswoole/graphs/contributors)\].

Security issues
---------------

[](#security-issues)

Security issues should be reported privately, via email, to the OpenSwoole develop team . You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message.

License
-------

[](#license)

OpenSwoole is open-sourced software licensed under the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html).

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance54

Moderate activity, may be stable

Popularity31

Limited adoption so far

Community31

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 55.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b6ce95d464ea49965275feb3effa29fbfe231be9a79217d4ed01f59401a16a5e?d=identicon)[bruced](/maintainers/bruced)

---

Top Contributors

[![matyhtf](https://avatars.githubusercontent.com/u/2017766?v=4)](https://github.com/matyhtf "matyhtf (7046 commits)")[![twose](https://avatars.githubusercontent.com/u/25978241?v=4)](https://github.com/twose "twose (2934 commits)")[![doubaokun](https://avatars.githubusercontent.com/u/313478?v=4)](https://github.com/doubaokun "doubaokun (932 commits)")[![shiguangqi](https://avatars.githubusercontent.com/u/654869?v=4)](https://github.com/shiguangqi "shiguangqi (337 commits)")[![GXhua](https://avatars.githubusercontent.com/u/7588080?v=4)](https://github.com/GXhua "GXhua (204 commits)")[![huanghantao](https://avatars.githubusercontent.com/u/22836925?v=4)](https://github.com/huanghantao "huanghantao (166 commits)")[![shenzhe](https://avatars.githubusercontent.com/u/916634?v=4)](https://github.com/shenzhe "shenzhe (152 commits)")[![windrunner414](https://avatars.githubusercontent.com/u/31621968?v=4)](https://github.com/windrunner414 "windrunner414 (139 commits)")[![xyzhu1120](https://avatars.githubusercontent.com/u/2072473?v=4)](https://github.com/xyzhu1120 "xyzhu1120 (135 commits)")[![Inokinoki](https://avatars.githubusercontent.com/u/8311300?v=4)](https://github.com/Inokinoki "Inokinoki (71 commits)")[![yunnian](https://avatars.githubusercontent.com/u/5779513?v=4)](https://github.com/yunnian "yunnian (65 commits)")[![sy-records](https://avatars.githubusercontent.com/u/33931153?v=4)](https://github.com/sy-records "sy-records (55 commits)")[![Yurunsoft](https://avatars.githubusercontent.com/u/20104656?v=4)](https://github.com/Yurunsoft "Yurunsoft (46 commits)")[![remicollet](https://avatars.githubusercontent.com/u/270445?v=4)](https://github.com/remicollet "remicollet (46 commits)")[![betashepherd](https://avatars.githubusercontent.com/u/5636922?v=4)](https://github.com/betashepherd "betashepherd (39 commits)")[![artem-from-ua](https://avatars.githubusercontent.com/u/845773?v=4)](https://github.com/artem-from-ua "artem-from-ua (38 commits)")[![bixuehujin](https://avatars.githubusercontent.com/u/1145280?v=4)](https://github.com/bixuehujin "bixuehujin (35 commits)")[![taobao-php](https://avatars.githubusercontent.com/u/5545992?v=4)](https://github.com/taobao-php "taobao-php (32 commits)")[![recoye](https://avatars.githubusercontent.com/u/491639?v=4)](https://github.com/recoye "recoye (19 commits)")[![sshymko](https://avatars.githubusercontent.com/u/1231423?v=4)](https://github.com/sshymko "sshymko (18 commits)")

---

Tags

asyncconcurrencycoroutinesopenswoolephp

### Embed Badge

![Health badge](/badges/openswoole-ext-openswoole/health.svg)

```
[![Health](https://phpackages.com/badges/openswoole-ext-openswoole/health.svg)](https://phpackages.com/packages/openswoole-ext-openswoole)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k104.3M829](/packages/laravel-socialite)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k38.6M289](/packages/laravel-dusk)[pinguo/php-msf

Pinguo Micro Service Framework For PHP

1.7k4.2k](/packages/pinguo-php-msf)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
