Login  |  Packages  |  Support  |  Bugs
PECL is deprecated.

Have you heard about PIE? 🥧 PHP Installer for Extensions (PIE) is the replacement for PECL. We recommend publishing your extension using PIE instead.

Find out more at https://github.com/php/pie.

Top Level :: Event :: swoole :: 6.1.11

swoole 6.1.11

Package Information
Summary Event-driven asynchronous and concurrent networking engine with high performance for PHP.
Maintainers Han Tianfeng < rango at swoole dot com > (lead) [details]
Bruce Dou < doubaokun at php dot net > (developer) [details]
Lufei < lufei at php dot net > (developer) [details]
License Apache2.0
Description 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
Homepage https://github.com/swoole/swoole-src
Release notes
Version 6.1.11
(stable)
- Build fix for platforms without futex: Changed sw_usleep to the standard usleep to fix compilation failure on that platform.
- WebSocket decoding validation: The decoder rejects CLOSE/PING/PONG control frames with RSV1 set before unmasking, preventing compressed control frames from entering the receive path.
- WebSocket encoding validation: The encoder rejects fragmented control frames or control frames with payloads exceeding 125 bytes, and makes ping() return false and set SWOOLE_ERROR_WEBSOCKET_PACK_FAILED when encoding fails.
- Thread stdio fd leak: After a thread exits, manually close the STDIN/STDOUT/STDERR file descriptors that were not released due to PHP_STREAM_FLAG_NO_CLOSE.
- Reactor unregistered fd lookup: When looking up an unregistered fd, return null instead of inserting an empty entry into the socket map, and change the accessor to const.
- SOCKS5 target host length validation: The DNS tunnel now validates that the target host length does not exceed 255 bytes, and returns an error as a handshake failure when it is too long.
- Thread scheduling policy preservation: When no policy is specified in Thread::setPriority(), first read the current scheduling policy before setting the priority, fixing the issue of using the invalid -1 policy.
- Buffered stream read fix: Under PHP 8.3, when the stream already has buffered data, use the non-waiting receive path so that hooked streams directly return buffered data without waiting for new events.
- Atomic wait on systems without futex: Implement an atomic wait registry based on a shared-memory hash table, replace the mutex with a spinlock, and add timeout, generation notification, and entry reuse mechanisms.
- Stream write timeout reporting: When fwrite encounters ETIMEDOUT, no longer print an error notice, preserve the timed_out metadata and do not set eof; only set eof for genuine write errors.
- Stream read timeout error preservation: When fread encounters ETIMEDOUT, return failure (false) instead of 0 so callers can identify the timeout through metadata, and do not mistakenly set eof.
- Poll dispatch socket identity preservation: The Poll reactor additionally stores the Socket pointer corresponding to each pollfd during set_events, and directly uses that pointer during dispatch, avoiding events being dispatched to the wrong socket after the fd is reused in a handler.
- Process pool message bus reuse: start() no longer recreates the message bus when it already exists, allowing the same process pool to be shut down and started again and still deliver messages normally.
- BASE event pool resource release: A multi-worker BASE server destroys the event process pool after the manager ends and reuses the message boxes already allocated by create(), fixing resource leaks.
- TCP listener rebindability: make_server_socket() enables SO_REUSEADDR only for TCP listeners, avoiding TIME_WAIT preventing immediate restart while not affecting Unix and UDP socket behavior.
- ProcessPool truncated packet handling: The stream/task protocol requires both the length prefix and the packet body to be read exactly in full; a short read is treated as an incomplete packet and the connection is closed, and old data in the reused buffer is no longer passed to the callback as a valid payload.
- Message queue key range validation: The Process, ProcessPool, and Server entry points validate the range before narrowing a PHP integer to key_t; keys outside the representable range of key_t are rejected, while unsigned 32-bit boundaries are still accepted.
- Multipart upload temporary file error: When a temporary file cannot be created for a multipart upload, mark UPLOAD_ERR_NO_TMP_DIR in the file information, avoiding handing an empty upload to the handler as a successful file.
- Support HTTP QUERY method: Add QUERY to the HTTP/1 method table and let URL-encoded form bodies go through the existing request parsing path, keeping parsing consistent between normal servers and coroutine servers.
- Apply stream timeout to hooked write operations: When stream_set_timeout() sets a timeout, also update both the read and write coroutine socket deadlines, so that a blocking fwrite() no longer exceeds the configured stream timeout.
- Coroutine HTTP client socket initialization: Initialize the internal socket zval to null at construction so that calling close() before connecting is safe and returns SWOOLE_ERROR_CLIENT_NO_CONNECTION.
- Pass null for DNS when there is no service: getaddrinfo() passes a null pointer instead of an empty string when no service is specified, fixing the issue on musl (Alpine Linux) where EAI_SERVICE caused resolution to always fail.
- Ignore external interrupts when preemption is disabled: Apply the scheduling deadline only when the preemptive scheduling thread is running, preventing signal interrupts triggered by other extensions from switching coroutines using stale context state when preemption is off.
- CPU affinity ID validation: Each affinity entry is converted only once and used for validation, diagnostics, and CPU_SET; negative IDs and IDs exceeding CPU_SETSIZE are rejected, and Thread::setAffinity() treats any nonzero return value from pthread_setaffinity_np as failure.
- Validate affinity IDs by CPU count: On top of the previous commit, change the upper limit to SW_CPU_NUM (also not exceeding CPU_SETSIZE), rejecting IDs outside the available CPU range before Linux silently trims the invalid mask.
- Prevent workers from executing manager-only signal handling: In signal handling, first verify that the current process PID equals the manager PID, avoiding a newly forked worker briefly inheriting the manager's signal handler and then repeatedly broadcasting SIGWINCH to itself.
- Preserve native coroutine socket errors: After a socket call fails, immediately read errno and store it in a local variable; shutdown() and check_liveness() no longer depend on the C runtime errno that may be overwritten.
- Initialize PHP hook after switching hooks: When switching from the native hook to the PHP hook, add the missing function cache initialization so that subsequent calls go through the swoole_* PHP functions instead of an empty cache.
- Redis server packet receive buffer handling: Check the length before reading the trailing CRLF, expand only when the buffer is full, and perform the expansion calculation without narrowing and within package_max_length, fixing fragmented request parsing.
- Preserve package length limit for partial settings: When set() on a coroutine socket does not provide package_max_length, no longer reset it to the default value, preserving the current limit.
- Crash when initiating PHP requests in non-Swoole threads: sw_is_main_thread() now uses the ZTS check, and all reads and writes of the task temporary directory are protected by sw_thread_lock, avoiding crashes in threads not created by Swoole.
- Coroutine HTTP server request boundaries and 100 Continue: When the chunked request buffer is full, expand it to the limit and return 413 if exceeded; use llhttp completion events to precisely determine request end and preserve pipeline bytes, and send a 100 Continue once before waiting for the request body.
- HTTP/1.0 ignores 100-continue: Send the 100 Continue interim response only for HTTP/1.1 (version 101) requests; HTTP/1.0 clients do not recognize informational responses, so wait directly for the request body.
- Reject overly long HTTP Upgrade values: Accumulate the Upgrade header length across multiple parsing fragments, and return a parse error when it exceeds the thread temporary buffer capacity, avoiding out-of-bounds writes and heap corruption.
- Server SSL context initialization: Always initialize the main context and register the SNI callback even when only SNI certificates are configured without a default certificate, and make SSLContext::create() return failure and release the incompletely initialized context when certificate loading fails.
- Preserve request fields across parse calls: Standalone Request::parse() now performs llhttp parsing of appended ranges on retained request storage, and rebuilds URL and header field spans across fragments, avoiding fragments being treated as complete fields or referencing freed pointers.
- Reject repeated calls to native resource constructors: The constructors of coroutine HTTP/HTTP2 clients, coroutine HTTP servers, Process Pool, Cookie, and Thread report an error on the second call, protecting the original native resources and object state from being replaced.
- Server cpu_affinity_ignore handling: First validate that the option must be an array, then compute candidate CPUs based on the process's actual affinity mask, ignore invalid IDs, report an error when all available CPUs are excluded, and free that memory when the Server is destructed.
- Terminate chunked responses after clearing trailers: Always append the trailing CRLF even if the public trailer property is empty or null, ensuring wire format integrity and connection reusability.
- RSHUTDOWN cleanup of PHP timers: Use std::vector and a timer ID list instead of a pointer array allocated with emalloc, look up each one again before deleting it, avoiding timers remaining until swoole_clean() due to a fatal error when request heap memory is exhausted.
- Register after-fork hook during MINIT: Move the registration of the after-fork hook from RINIT to MINIT, avoiding repeated mounting when requests are started and shut down repeatedly in thread mode.
- curl multi preserves select readiness state: curl_multi_exec is driven by curl_multi_socket_action, and select is only responsible for waiting and recording readiness, covering polling, callback timing, removal, and reuse scenarios.
- HTTP/1 trailer completion fix: Determine whether sending is needed using the actual length of the built trailer buffer, preserve the trailing CRLF even for trailers containing only null values, and make end() return false when trailer sending fails instead of being overwritten by a success result.
- Preserve incomplete packets on receive timeout: Under the length protocol, no longer clear the read buffer on timeout and do not set offset to the packet length, allowing subsequent reads to continue assembling the complete packet from the interruption point; HTTP/2 and socket fragmentation tests cover this behavior.
- Recognize PHP sockaddr length macros on BSD: Change the compilation condition for address traversal to HAVE_SOCKADDR_SA_LEN or HAVE_STRUCT_SOCKADDR_SA_LEN, fixing the check on BSD platforms.
- Coroutine exception delivery in SPL directory iteration: Save EG(opline_before_exception) and the interrupt opline for each PHP coroutine, and restore the suspended user code through Zend's normal exception path on external cancellation; also support throw-style self-cancellation and reject non-coroutine main contexts.
- Reject global HTTP response headers in coroutines: At coroutine runtime, replace http_get_last_response_headers() with a handler that indicates it is unsupported, and restore the native handler after runtime stops, avoiding request-level global headers polluting each other across coroutines.
- CPU affinity for worker application configuration: Extract cpu_affinity_ignore validation into a separate helper function, and select CPU binding for event/task workers based on the actual allowed affinity mask before the worker startup callback; in THREAD mode bind the current pthread, and keep the master mask unchanged.
- Out-of-bounds read on empty PDO pgsql error message: _pdo_pgsql_trim_message() first checks whether the length is 0 and directly returns an empty string, avoiding strlen - 1 underflowing to SIZE_MAX and then reading bytes before the buffer.
- Do not lose signals during signal handling: The sigaction fallback path fills sa_mask for non-safe handlers to block other signals, so that signals arriving during handling remain pending and are delivered after handling returns, fixing the issue where the master's SIGTERM is lost during SIGCHLD handling.
- Enforce EOF packet length limit: Immediately report SW_ERROR_PACKAGE_LENGTH_TOO_LARGE when the first complete EOF packet exceeds package_max_length, or when an unterminated buffer reaches/exceeds the limit; coroutine sockets, synchronous/asynchronous clients, split mode, and server protocols enforce this uniformly, preserving packets exactly equal to the limit and valid first packets in merged reads.
- Validate WebSocket handshake response headers: The coroutine HTTP client validates Upgrade: websocket, Connection: Upgrade, and Sec-WebSocket-Accept in the 101 response (recomputed and compared using the request key); if invalid, the handshake fails and the connection is closed.
- UNIX datagram address ownership: When recvfrom has no peer address, clear the cached sun_path; during destruction, first refresh its own bound address with getsockname before unlinking, avoiding mistakenly deleting the peer socket file when releasing the receiver or exposing the previous peer address to PHP.
- write_func receives decompressed response body: Compressed responses are decompressed before being handed to write_func; the callback receives plaintext chunks and the internal body buffer is cleared; covers gzip/deflate/br and compressed SSE streams.
- Safe buffer expansion for WebSocket compressed output: Z_SYNC_FLUSH output may exceed deflateBound(); change to extend first when bytes_written + max_length exceeds capacity, and accumulate length according to the write position, avoiding out-of-bounds and length loss; add regression tests for incompressible payloads and control frames.
- Shared settings array isolation: Each set() performs SEPARATE_ARRAY on the setting property array before merging, avoiding in-place modification of a copy-on-write shared array, so that previously taken snapshots and caller-provided arrays remain unchanged; also remove the erroneous extra reference to the port object when inheriting settings across multiple ports.
- Preserve reload initiated in worker callbacks: The wait loop no longer deletes reload tasks during the reload_init phase, and instead waits until the next initialization round fills in the worker snapshot before checking completion, avoiding reloads requested in callbacks being discarded prematurely.
- Backport adaptation for pending reload and regression cases: When there is already a pending reload in the queue, use wait_process with WNOHANG to avoid blocking, and fix the pid is less than or equal to 0 check; on the test side, reap child processes, drain accepted HTTP connections before closing listeners, and adapt the test runner's output limit handling.
- Free captured HTTP/1 Content-Type: Move the freeing of content_type out of the branch that only matches compressed types, so that it is also freed when Content-Encoding is set and compression is disabled due to a mismatch, fixing a memory leak of about 1 KiB per request.

[ Latest Tarball ] [ Changelog ] [ View Statistics ]
[ Browse Source ] [ Package Bugs ] [ View Documentation ]

Dependencies for release 6.1.11
PHP Version: PHP version 8.4.99 or older
PHP Version: PHP 8.1.0 or newer
PEAR Package: PEAR 1.4.0 or newer
PRIVACY POLICY  |  CREDITS
Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Jun 17 13:08:36 2026 UTC
Bandwidth and hardware provided by: pair Networks