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.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
6.1.2 2025-11-11 swoole-6.1.2.tgz
6.1.1 2025-10-30 swoole-6.1.1.tgz
Show all releases

Changelog

Version Message
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.
6.1.2 - No longer throw warnings when failing to set the `socket` receive/send buffer size
- Fixed an issue in `Swoole\Http\Server` where the `onClose` callback might execute before `onRequest` when handling `HTTP2` requests, leading to a use-after-free problem
- Optimized the `getSocket()` method by duplicating the file descriptor when exporting the `php sockets` resource object, preventing `php sockets` from affecting the `socket` held by `Swoole` upon closure
- Fixed a memory leak issue in `Swoole\Async\Client`
- Fixed an issue where `Swoole\Coroutine\Http\Client` of `IPv6` type could not use `Socks5` proxy
- Synchronized updates to adapt to relevant changes in the `CURL` extension in `PHP 8.4`
- Added the `async.file://` file protocol, which allows enabling coroutine scheduling for specific file operations even when global file coroutine support is disabled
6.1.1 - Fixed a compilation failure caused by missing `zlib` dependency.
- Optimized the resource management logic in the `curl` module to prevent use-after-free risks.
- Resolved the absence of `fdatasync` on macOS systems.
- Improved the log output format for coroutine deadlock detection.
Show complete changelog