swoole

Event-driven asynchronous and concurrent networking engine with high performance for PHP.


Event-driven asynchronous and concurrent networking engine with high performance for PHP.
- event-driven
- coroutine
- asynchronous non-blocking
- multi-thread reactor
- multi-process worker
- multi-protocol
- millisecond timer
- built-in tcp/http/websocket/http2 server
- coroutine tcp/http/websocket client
- coroutine read/write file system
- coroutine dns lookup
- support IPv4/IPv6/UnixSocket/TCP/UDP
- support SSL/TLS encrypted transmission

License: Apache2.0

Latest releases

Version Release Download
6.2.0RC1 2026-02-16 swoole-6.2.0RC1.tgz
6.1.6 2025-12-28 swoole-6.1.6.tgz
6.1.5 2025-12-21 swoole-6.1.5.tgz
6.1.4 2025-12-06 swoole-6.1.4.tgz
6.1.3 2025-11-26 swoole-6.1.3.tgz
Show all releases

Changelog

Version Message
6.2.0RC1 - Added coroutine-based `FTP` client. By including the `--enable-swoole-ftp` option during compilation, coroutine support for `FTP` operations can be enabled to avoid network blocking.
- Added coroutine-based `SSH` client. By including the `--enable-swoole-ssh` option during compilation, coroutine support for `SSH` operations can be enabled to improve concurrency efficiency.
- Added support for `io_uring` in the `HTTP` coroutine server. The `HTTP` coroutine server can now utilize the high-performance `io_uring` event mechanism. Enable it by adding the `--enable-uring_socket` option during compilation for better I/O performance.
- Added the `Swoole\RemoteObject\Server` module, providing transparent coroutine operation support for `MongoDB`.
- Added the `Swoole\Coroutine::setTimeLimit()` function to control coroutine execution timeout, preventing coroutines from occupying resources for extended periods.
- Added `URL` rewriting support for the `HTTP` static file server.
- Added coroutine support for `pdo_firebird`.
- Added support for `PHP 8.5`.
- Added coroutine support for the `gethostbyname` function.
- Optimized the implementation of `Server::shutdown()`, replacing signal communication with pipe communication in `Process` mode.
- In the callback functions of Swoole's HTTP servers (including Swoole\Http\Server, Swoole\Http2\Server, and Swoole\Coroutine\Http\Server), the `server` property of the `Swoole\Http\Request` object now includes a new `server_addr` field, which identifies the server's IP address.
- `SSH` and `FTP` coroutine clients cannot coexist with PHP's `ext-ssh` and `ext-ftp`. To enable these features, the PHP `ssh` and `ftp` extensions must be disabled.
- Fixed an issue where the HTTP2 server session was released multiple times in a multi-threaded environment.
- Fixed an issue in version `8.5` where `refresh_memory_manager()` must be executed after forking a child process or creating a child thread; otherwise, the program would crash.
- Fixed an issue where the `swoole_get_local_mac` function did not work correctly on `macOS` systems.
- Fixed a potential crash issue that could occur when users manually suspended coroutines in a multi-threaded environment.
- Fixed compilation errors on Alpine systems.
- Fixed a memory leak issue when function hooking failed.
- Fixed thread safety issues during the coroutinization process of `pdo_sqlite` and `pdo_oci`.
- Fixed the `sw_php_print_backtrace` function to ensure its output format matches the backtrace information format of PHP's built-in functions.
- Executing `php --ri swoole` now outputs version information for `libpq`.
- Optimized logic related to `io_uring` in file coroutine operations.
- Added PHP call stack information output when event addition fails.
- Optimized the implementation code for the `swoole_get_local_ip` and `swoole_get_local_mac` functions.
- Optimized the coroutine waiting time for file locks to prevent exponentially increasing sleep times from making locks increasingly difficult to acquire.
- Improved compatibility with the `Android` platform.
- Removed the `--enable-openssl` compilation option; support for `OpenSSL` is now included by default.
- `--enable-uring-socket` requires explicitly specifying either `--enable-iouring` or `--with-liburing-dir`.
- `PHP 8.1` is no longer supported.
- Swoole 6.2.0 RC1 is currently a release candidate version and can only be used in testing environments. It is prohibited to use it in production environments.
6.1.6 - Fix the issue where the `finish` attribute remains `false` when receiving continuous frames in `websocket`.
- Fix compilation warnings generated when using the `--enable-swoole-sqlite` compilation option.
- Automatically remove HOOK_SOCKETS from the runtime hook flags when the ext-sockets extension is detected as not enabled.
6.1.5 - Fixed a crash issue when users manually suspend coroutines in a multithreaded environment
- Fixed the issue where the `System::socket_poll()` function incorrectly closed sockets after failing to add events
- Fixed decompression failure in `WebSocket` when compressing message frames, caused by certain server environments not supporting `MAX_MEM_LEVEL=9`
- Fixed data reception errors in `WebSocket` when receiving consecutive compressed data frames, caused by the buffer not being cleared in time
- Fixed the `data race` issue in the `pdo_oci` coroutine client when processing non-`PDO_PARAM_LOB` data
- In `Http Server`, when developers set the `Content-Encoding` header, `Swoole` will no longer automatically compress the response body. Instead, developers need to implement compression logic themselves and output the corresponding content.
- Removed the `PDO::sqliteCreateAggregate()`, `PDO::sqliteCreateCollation()`, and `PDO::sqliteCreateFunction()` functions in the coroutine environment. Their implementation principle involves calling PHP functions as callbacks in the `sqlite3` engine, which is only feasible in single-threaded synchronous blocking mode. In `Swoole` coroutine mode, the `C` functions of `sqlite3` need to run in asynchronous `AIO` threads. In the `ZTS` version, this can cause null pointer reads, while in the `NTS` version, it may lead to `data race` issues and occasional crashes.
- Removed support for the `open_basedir` setting in the `pdo_sqlite` coroutine client. It is unsafe to read `PG(open_basedir)` in a multithreaded environment. Ensure that the `sqlite3` database file path is a constant or other safe path. Do not use user input parameters as part of the `sqlite` database file path.
6.1.4 - Fix the memory leak issue in the curl module.
6.1.3 - Fixed Safari Browser Compatibility Issue: Resolved a flow control compatibility issue in HTTP/2 servers when sending large files to Safari browsers.
- Fixed Data Race in Date Response Header Caching: Addressed a data race issue in the `Date` response header caching of HTTP/2 servers in multi-threaded mode.
- Fixed `package_max_length` Configuration Not Taking Effect:
- The server now returns a `413 Payload Too Large` error when the `Content-Length` in the received `Header` frame exceeds the configured value.
- The server sends an `HTTP/2 RST_STREAM` frame to terminate the stream when the total length of consecutively received `Data` frames exceeds the configured value.
- Fixed Memory Out-of-Bounds in Multi-threaded Coroutine Mode: Resolved a memory out-of-bounds issue when enabling `enable_reuse_port` in the multi-threaded coroutine version of the `HTTP/2` server.
- Fixed TLS Variable Destruction Issue: Addressed a `double free` issue occurring during the destruction of `TLS (Thread Local Storage)` variables when threads exited in the multi-threaded `HTTP/2` server.
- Fixed Packet Assembly Exception in `Redis\Server::format()` When Processing Large Strings.
- Fixed Control Frame Data Contamination Issue: Resolved an issue where automatically replied `ping`/`pong`/`close` control frames in the `WebSocket` server carried residual data from previous text or binary frames due to uncleared cache.
- Fixed Data Race in `swoole_get_task_tmpdir()`: Addressed a data race issue when calling this function in a multi-threaded environment.
- Fixed Memory Out-of-Bounds Access in Runtime Hooks: Resolved a memory out-of-bounds access issue triggered when setting runtime hooks in a multi-threaded environment.
- Important Change: Runtime hooks can now only be set in the main thread and must be configured before creating any child threads.
- Fixed FreeBSD Compilation Failure: Resolved compilation failures on FreeBSD systems.
- Added Android Platform Support: Improved compatibility with the Android platform, now supporting execution in the Termux environment.
- Synchronized PHP 8.x cURL Module Updates: Adapted to relevant updates in the `cURL` extension for PHP versions 8.1, 8.2, and 8.3.
Show complete changelog