Changelog

Curated highlights per release: every notable change to the server, the PHP API and the images. The full, unabridged history lives in CHANGELOG.md.

Breaking changes 10

  • Profiler formats are xhprof and collapsed

    PROFILER_OUTPUT_FORMATS now defaults to xhprof,collapsed. speedscope and pprof are no longer formats: a list that names them writes the rest with a startup warning for each, and a list with nothing else writes both defaults. For speedscope, download /__profiler/runs/{id}.collapsed and drop it on speedscope.app. Runs stored by 0.15.0 stay listed, but their .speedscope.json and .pprof files answer 404.

  • Profiles start only from the header, sampling or the script

    The OXPROF cookie and the __oxprof query parameter do nothing, even with the right token. Send the X-OxPHP-Profile header instead; in a browser, a request-header extension does that for every page. PROFILER_SAMPLE_RATE and OxPHP\Profile\start() work as before.

  • OxPHP\Profile\pause() and resume() are gone

    Calling either raises Error. Replace a pair with stop() and start(), called only when OxPHP\Profile\is_active() is true: resume() did nothing on a request that was not being profiled, while start() turns profiling on for it.

  • /__profiler/stats is gone

    Read the oxphp_profiler_* series on /metrics. The label values format="speedscope", format="pprof", source="cookie" and source="query" no longer appear, so a dashboard or alert that selects them goes empty.

  • Profile export sends the bare format

    PROFILER_EXPORT_URL receives exactly what PROFILER_EXPORT_FORMAT names. A URL ending in /run/import or /api/profiler/store no longer gets an xhgui or Buggregator envelope; to keep pushing to either, put an adapter in front of it that wraps the body.

  • Profiler attributes removed

    Delete #[Profile], #[Exclude], #[Sample] and #[Tag] from your code. PHP ignores an attribute whose class is missing, so the code keeps running without their effect; only ReflectionAttribute::newInstance() on one of them throws Error.

  • HTTP/1.1 requests need a valid Host

    A request with no Host, with Host on two lines, or with a Host that is not a valid host and port (a raw UTF-8 name, an IPv6 zone identifier) gets 400 and never reaches PHP. A health check or script that writes HTTP/1.1 by hand must send Host, as curl, wget, browsers and Kubernetes HTTP probes already do. HTTP/1.0 requests may leave it out, and the internal listener (INTERNAL_ADDR) does not check it.

  • A Request object belongs to its request

    In Worker mode, every method of an OxPHP\Http\Request called while the worker serves another request throws OxPHP\Http\Exception\NoActiveRequestException with the message Cannot access HTTP request: this Request object belongs to another request. That catches an object built before oxphp_worker() and kept in a container or a static, one a decorator keeps from its constructor (a decorator lives as long as the worker), and one read in a __destruct() that runs during a later request. Call oxphp_http_request() inside the handler and pass the object on. A new OxPHP\Http\Request() built where oxphp_http_request() throws (an oxphp_async() thread, oxphp run) now throws the same exception instead of answering with empty values, and ReflectionClass::newInstanceWithoutConstructor() refuses the class with ReflectionException.

  • RUNTIME_HOOKS=1, true and all now include curl

    On upgrade, curl_exec() and curl_multi_select() stop holding the worker thread in Worker-mode requests and oxphp_async() tasks, and /config and oxphp_server_info()['runtime_hooks'] report ["sleep","streams","net","curl"]. Results do not change, but a cURL handle shared between requests (kept in a service or a static) is now used in turn: a call waits for another fiber's call on it, or throws OxPHP\Async\AsyncException. A task cancelled mid-transfer gets AsyncException from that cURL call, with curl_errno() at CURLE_BAD_FUNCTION_ARGUMENT (43) after curl_exec() or curl_multi_errno() at CURLM_UNRECOVERABLE_POLL (12) after curl_multi_select(). To keep the 0.15.0 behavior, set RUNTIME_HOOKS=sleep,streams,net.

  • Task functions are checked whole

    In an oxphp_async() task, a function of your script that calls a function of its own file the task's thread has not loaded, or declares a class, is refused with Error as the thread enters it, even when the call sits in a branch it never takes. Such a function used to start, and could crash the server on reaching that call. Load what it calls with opcache.preload, or include the file that declares it inside the task before the call.

Added 2

  • PHP 8.6

    OxPHP runs on PHP 8.6, and images are published for it from this release: :php8.6, :<version>-php8.6, the -alpine<X.Y> and patch-pinned tags, their -trixie counterparts, and the nightly :php8.6-nightly and :php8.6-nightly-trixie. :latest and the other default tags stay on PHP 8.5, and earlier releases are not rebuilt on 8.6. The official PHP 8.6 images ship without mbstring and drop -zts from their ZTS tags (php:8.6-alpine3.24, php:8.6-trixie); the OxPHP 8.6 images add mbstring back, with zip.

  • RUNTIME_HOOKS=curl

    The waits of a cURL transfer suspend the fiber instead of holding the worker thread: everything curl_exec() waits for, from resolving the host name to the answer, and the wait in curl_multi_select(). Two concurrent one-second transfers on one thread now take one second instead of two, for Guzzle, Symfony HttpClient and any client built on ext/curl. Requests sharing one multi handle, as Symfony HttpClient does and Guzzle does for asynchronous requests, take turns calling on it while their transfers run side by side, so a curl_multi_select() can return 0 before its timeout. A call that cannot wait for a handle, or waits past the smaller of max_execution_time and default_socket_timeout, throws OxPHP\Async\AsyncException. Linux only, with libcurl loaded as a library of its own as in the official images, and not with ext/curl built as a shared extension under PHP 8.4 on glibc; needs neither streams nor net. A wait libcurl makes outside these calls, such as while a handle is destroyed, still holds the thread.

Changed 6

  • payload() reads form bodies on PUT, PATCH, DELETE and QUERY

    $request->payload() now returns the fields of an application/x-www-form-urlencoded body on these methods, where it returned an empty array. It parses them as parse_str() does: fields split on arg_separator.input, parsing stops at a raw NUL byte, and the max_input_vars warning comes from the payload() call that reaches the limit. $_POST stays empty, as under PHP. A multipart/form-data body on these methods still returns an empty array, with file() at null: read it with request_parse_body().

  • A new worker runs its first request alone under runtime hooks

    In Worker mode with RUNTIME_HOOKS on, a worker serves its first request alone until that request ends or 250 ms after it first waits, so the next request does not find a lazily built service half built (Yii3 answered 500 with a CircularReferenceException on fresh workers under load). The requests held back wait in the shared queue, where any other free worker can take them, within their QUEUE_WAIT_TIMEOUT_MS. It happens once per worker start, recycle or pool scale-up; a build that runs longer, or happens in a later request, is still the application's to arrange.

  • More Shared\Pool callbacks are refused on other threads

    In Worker mode, and for a Shared\Pool created inside an oxphp_async() task, a factory or destroy callback that reaches a class each request links in its own memory is refused on threads other than the one that created the pool. That is a class with a parent, interface or trait outside OPcache's shared memory (declared in eval(), say), with a method typed against such a class or against an enum opcache.preload does not load, or linked while that memory was full. It counts when the callback reaches the class through self::, static::, parent::, new static, forward_static_call(), forward_static_call_array(), __callStatic(), or an eval(), include or require in one of its methods. Such a callback throws Error from the acquire call, or is skipped as a destroy callback; load the class and what it depends on with opcache.preload.

  • OxPHP is a Zend extension

    php -v now lists OxPHP as a Zend extension, and php -m lists it under [Zend Modules].

  • Xdebug installs with PIE

    The Docker guide and examples/dockerfile/Dockerfile install Xdebug with PIE, because the official PHP images no longer ship pecl from 8.6 on. The php-dev stage copies pie from ghcr.io/php/pie:1-bin and needs unzip while it runs. A Dockerfile that still calls pecl install keeps working on PHP 8.4 and 8.5.

  • Fewer allocations per request

    A request to a PHP script now costs about 14 heap allocations on the server's side instead of 130, and an idle server none. That is worth about 7% of CPU on a cached static file and nothing measurable on a script. Each PHP worker thread keeps up to 32 KiB of request strings and 64 KiB of output buffer between requests; a larger request gives the extra back when it ends, or in Worker mode when the next one starts.

Removed 3

  • Profiler triggers, functions and attributes

    The OXPROF cookie and __oxprof query-parameter triggers, OxPHP\Profile\pause() and OxPHP\Profile\resume(), and the #[Profile], #[Exclude], #[Sample] and #[Tag] attributes. #[Mark], #[SlowThreshold] and #[MemoryThreshold] stay.

  • Profiler variables

    PROFILER_INTERNAL, which nothing read, and PROFILER_EXPORT_XHGUI, PROFILER_EXPORT_BUGGREGATOR, PROFILER_EXPORT_APP_NAME and PROFILER_EXPORT_TAGS with the xhgui and Buggregator envelopes. They are ignored if still set, and a malformed value in them no longer stops the server at startup.

  • Profiler formats and routes

    The speedscope and pprof formats (building OxPHP no longer needs protoc), the profiler's landing page, /__profiler/stats, DELETE /__profiler/runs/{id} and the speedscope redirect. The routes left are /__profiler/config, /__profiler/runs, /__profiler/runs/{id} and /__profiler/runs/{id}.{format}.

Fixed 26

  • Shared Redis clients under runtime hooks

    A Predis client shared between requests no longer closes its connection and ends another request with 500: with streams and net hooked, an fwrite() or fputs() to a connection another request is waiting on now waits for that reply, for at most the smallest of the stream's timeout, max_execution_time and default_socket_timeout. With streams hooked, phpredis 6.3.0RC1 (the only phpredis that builds on PHP 8.6 so far) no longer closes the connection under a waiting request, which ended it with oxphp: the connection this request was reading from was closed by another fiber while this one waited for its reply. A phpredis call from a destructor run between requests returns false while a fiber is inside a call on that connection, and Redis objects sharing one persistent connection under redis.pconnect.pooling_enabled=0 take turns on it. A shared userland client is still guarded one reply at a time, not one transaction: give it a connection per request, or use phpredis.

  • Decorated calls that exit or run out of memory

    exit() or die() in a decorated function, a Fiber destroyed while suspended in one, and memory_limit reached in one no longer crash the server. That covers decorators registered with oxphp_register_decorator(), #[OxPHP\Apm\Trace] with OTEL_APM_ENABLED=true, and #[OxPHP\Profile\Mark], #[OxPHP\Profile\SlowThreshold] and #[OxPHP\Profile\MemoryThreshold] with PROFILER_ENABLED=true. Each ends as it does without a decorator: after() is not called for a call that does not return, and a #[Trace] span closes without an exception event, with an error status only after memory_limit.

  • Fatal errors in an extension's request shutdown

    On PHP 8.4.28, 8.5.13, 8.6.0 and later, a fatal error that cuts an extension's request shutdown short (GHSA-g3vh-838c-65v7) no longer stops the server; a userland-wrapper stream kept in $_SESSION by a script that then unsets $_SESSION is one way to cause it. The request gets its error response. Outside Worker mode its PHP thread is retired and replaced, logged at WARN as PHP worker thread retired: an extension's request shutdown was cut short, with the extension's name in module. oxphp run exits with 255 there, where php exits with 1.

  • Where a fiber cannot switch

    array_multisort() no longer crashes the server when two sorts on one thread wait in their comparisons. A wait in its comparisons now holds the thread, and starting, suspending or resuming a Fiber there throws FiberError, which stock PHP does not. There, in a FILTER_CALLBACK of filter_input_array() given a definitions array, and in the cleanup at the end of a request, Shared\Channel::send() and recv() throw OxPHP\Shared\SharedException if they would have to wait, and sendTimeout(), recvTimeout(), oxphp_async_await_race() and oxphp_async_await_any() wait on the thread for their timeout, so give them one. They used to throw RuntimeException (send: fiber_await rc=1) or AsyncException (await fan-out: fiber yield outside a fiber).

  • Request state after a wait in Worker mode

    A request that waits before its headers go out (in oxphp_async_await(), oxphp_sleep(), oxphp_usleep(), or a sleep(), usleep() or socket wait RUNTIME_HOOKS took over) now runs its own header_register_callback() callback and gets PHP's default Content-Type only when it would without waiting; a callback still registered when its request ends is dropped. http_get_last_response_headers(), the string strtok() is splitting, ob_implicit_flush(), whether output has gone out, and the file and line headers_sent($file, $line) reports now belong to each request. An earlier request can no longer make a stream send every write at once, or raise Cannot change zlib.output_compression - headers already sent before anything was written. implicit_flush in php.ini is applied once, as the worker boots.

  • serialize(), unserialize() and sorts in suspended fibers

    A Fiber, or in Worker mode a request, suspended inside serialize(), unserialize(), usort(), uasort() or uksort() no longer shares that call's state with the others, which let an unserialize() resolve r: and R: references against the wrong values and a sort fail with Error: Invalid callback. A fatal error inside serialize() or unserialize() no longer breaks both for the rest of the worker's life, which made sessions fail with Failed to decode session object. Session has been destroyed. This uses one of PHP's six per-fiber extension slots; if other extensions took the rest, the state stays shared as in PHP.

  • Autoloaders in Worker mode and tasks

    A class whose autoloader ended in a fatal error is autoloaded again on the next lookup instead of staying missing on that thread, and an autoloader suspended in one request or task no longer makes the class missing for the others. Since two of them can now run one class's autoloader at once, an autoloader that can be suspended before it includes the class file should check class_exists($class, false) on resuming: including the file twice is a fatal error. A wait inside the class file itself cannot be guarded this way.

  • Worker cleanup between requests

    Output from a destructor run as the worker lets go of a finished request no longer lands in the next request's response and breaks its header() calls. A wait in a decorator's after() during the cleanup after a fatal error, a timeout or a departed client now blocks the worker, instead of letting a healthy request run and be counted toward the consecutive-error recycle. In that cleanup a new Fiber starts, Fiber::getCurrent() no longer returns null, and an exception escaping a destructor or a stream filter's onClose() is reported as uncaught instead of reaching another request's set_exception_handler(). When a stream's client leaves, every destructor due at that flush now runs, and what it writes is discarded.

  • The cycle collector after fatal errors

    With zend.enable_gc = 0, a fatal error or a cancelled request in Worker mode or a task no longer crashes the server. Cycles freed by the cleanup after a fatal error, a timeout or a cancellation are now collected instead of counting toward the 4 MiB of growth that recycles a worker, and gc_collect_cycles() there no longer stops the collector (logged as a fatal interrupted a cycle collection). An oxphp_async() pool thread whose collector a fatal error stopped is now replaced.

  • Fatal errors that ended a worker

    In Worker mode a fatal error now ends only its own request when it comes from a session save handler's close(), the destructor of a top-level static in an included file, an included file under Xdebug or another extension that overrides the executor, a parameter default that a named-argument call skipped (f(o: $x)), or the destructor of an exception left by after(). A fatal error or uncaught exception in the destructor of an object a request left in a superglobal, or captured by an oxphp_async() task it never awaited and that never started, fails that request (500 if its headers have not gone out) and counts toward recycling; header() there warns Cannot modify header information. One in a destructor run by the cycle collection the worker runs periodically between requests recycles the worker as a scheduled exit: 503 with Retry-After, the code after oxphp_worker() runs, and a count under oxphp_worker_recycles_by_reason_total{reason="scheduled"}. One in a task closure released between requests is a logged warning.

  • Destructors of other requests after a fatal error

    In Worker mode and tasks, a fatal error (max_execution_time included) no longer cancels the __destruct() of objects that other requests, other tasks or the worker hold, which left locks held and buffers unflushed; only the failed request's own variables skip theirs. Unlike PHP-FPM, an object of the failed request that lives on (in a shutdown function, an output handler, $_SESSION or a reference cycle, or on PHP 8.5 in the backtrace error_get_last() returns) is destructed when it goes, possibly during another request. Under Xdebug's develop mode, its default, a fatal still skips every destructor on the thread.

  • Memory left by fatal and compile errors

    In Worker mode and tasks, a fatal error or a timeout no longer leaves allocated what the code held mid-expression (a foreach's array, a call's arguments, what array_map() had built), except inside generators and in a few narrow cases, and a compile error gives back its syntax tree, at least 32 KiB a time. On PHP 8.5, warnings no longer go missing for the rest of the worker's life after a compile error in a file OPcache does not cache. On PHP 8.4.27, 8.5.12 and later, running out of memory in a decorator's after() during that cleanup no longer skips the onClose(), stream_close(), after() and destructor calls that follow.

  • A request ended inside a cURL callback

    In Worker mode, a fatal error, a timeout or a write to a departed client inside a cURL callback such as CURLOPT_WRITEFUNCTION leaves the handle refused for good (API function called from within callback; curl_reset() and curl_close() throw), so an HTTP client built at boot failed every later request. The worker is now recycled at its next idle moment, logged and counted under oxphp_worker_recycles_by_reason_total{reason="scheduled"}. A callback run as a handle is destroyed, or a CURLOPT_DEBUGFUNCTION that curl_setopt() calls, is not covered.

  • payload(), attributes() and whole-number names

    $request->payload() takes a body as a form only when PHP would, comparing the type name up to the first ;, comma or space whole and ignoring case: application/x-www-form-urlencoded-x or multipart/form-data-x returns null, where 0.15.0 returned an empty array. application/json is still matched by prefix. payload(), file(), files(), $session->get() and $session->has() now find a whole-number name such as '12', and attributes()->all() keeps a name such as '7' under the integer 7, as PHP arrays do. payload() no longer changes json_last_error().

  • query(), header() and cookies()

    query('a') returns the last of a repeated parameter, as $_GET does, and a pair with no name (?=x) is no longer listed. header('X-Foo', 'fallback') returns '' for a header sent with an empty value. cookie() and cookies() split the Cookie header as $_COOKIE does: =x is ignored, a bare flag is a cookie with an empty value, trailing whitespace is kept, and the first of two cookies with one name wins. query() and cookies() now stop at max_input_vars, where query() stopped at 1000 pairs and cookies() had no limit.

  • UploadedFile and Session with disabled functions

    OxPHP\Http\UploadedFile::moveTo() returns false with a warning when move_uploaded_file is in disable_functions, and OxPHP\Http\Session::id() and name() return '' with a warning when session_id or session_name is. They threw Error: Invalid callback, or called an application function of that name. UploadedFile::type() no longer returns application/octet-stream after a call that threw: the next call detects the type again.

  • Host header checks

    Besides the 400 described under Breaking (RFC 9112 §3.2), an absolute-form target or an HTTP/2 :authority with an invalid host or port is refused the same way, and an HTTP/2 request without :authority is held to the HTTP/1.1 rules. A CONNECT refused for its Host or target now closes the connection. Host: example.com: gives SERVER_PORT the scheme's default, and so does a port in a trusted proxy's X-Forwarded-Host that is not a number up to 65535.

  • Reserved __oxp_ cookies

    A cookie name PHP would turn into an __oxp_ key (__oxp.x becomes __oxp_x, and __oxp[a] an array under __oxp) is now stripped along with the __oxp_* cookies, from $_COOKIE, $_SERVER['HTTP_COOKIE'] and the request object. A Cookie header left with only a stray ; once they are stripped is now absent, where it reached PHP as ''.

  • HTTP/2 requests with a full header map

    With H2_MAX_HEADER_LIST_BYTES raised well above its default, a request carrying as many distinct header names as a map can hold is no longer reset by a panic. The Cookie header is dropped in that case, and a request whose Host cannot be written gets 431.

  • Profiler output

    A .collapsed profile now counts each call stack's own time, so the widths of a flamegraph add up, and repeated calls on one stack share a line. An empty PROFILER_OUTPUT_FORMATS now turns disk output off: runs no longer spend PROFILER_DISK_MAX_PER_SEC or appear in /__profiler/runs with no files behind them, and that route answers that disk storage is disabled.

  • OPcache restarts

    A restart from opcache_reset(), or from a full cache past opcache.max_wasted_percentage, no longer runs while other PHP threads still run cached code, which could crash the server. On Linux it waits until none can: requests started meanwhile run uncached, as under PHP-FPM, and each worker and oxphp_async() pool thread is replaced at its next idle moment (a worker runs its bootstrap again). Under steady load a thread holding a restart stops taking work for up to 5 seconds; with PHP_WORKERS=1 or ASYNC_WORKERS=1 requests wait meanwhile and are refused after QUEUE_WAIT_TIMEOUT_MS. A request that never ends, such as a Server-Sent Events stream, holds the restart; past opcache.force_restart_timeout the server logs a warning and keeps waiting.

  • Shared\Pool callbacks that crashed other threads

    In Worker mode, and for a Shared\Pool created in an oxphp_async() task, a factory or destroy callback no longer crashes another thread (zend_mm_heap corrupted, among others) through a method with static variables on a class each request links itself, an eval(), include or require in a class method, or a callable built at run time with self, static or parent ([Base::class, 'self::make']). Each throws Error instead, which Closure::fromCallable(), call_user_func() and call_user_func_array() may wrap in a TypeError (must be a valid callback, (null)). A method without static variables runs there, and throws Class "…" not found when the thread lacks a class it names. The Shared Pool page lists the gaps left.

  • oxphp run exit codes

    oxphp run exits with the code a shutdown function or destructor sets after the script ends, as php does, so one that fails now gives a non-zero code (255 for an uncaught exception) where run exited with 0. A script whose output cannot be written, as in oxphp run export.php | head -1, stops at the failed write and exits with 255; with ignore_user_abort(true) it carries on with connection_status() at 1 and still exits with 255. Both hold for a script file, -r code and a script on standard input. Output an oxphp_async() task prints on a pool thread is still only dropped.

  • setlocale() per thread

    Each PHP thread now has its own locale, so a request's setlocale() no longer changes it for requests on other workers, and the end of a request no longer resets theirs (on Alpine this touched escapeshellarg() and escapeshellcmd(), on Debian with locales installed the decimal separator of sprintf('%f')). In Worker mode the locale still outlives the request unless the request puts it back, and one set in a task stays on its async worker thread. An extension that calls the C library's setlocale() itself, as intl's NumberFormatter::parse() does, changes only the process-wide locale, which requests no longer use.

  • Documentation: timing, timeouts and shutdown

    $request->startTime(), $_SERVER['REQUEST_TIME'] and oxphp_server_info()['request_time'] hold the moment a worker took the request, so they leave out the queue wait, which oxphp_queue_wait_us reports. A request past max_execution_time ends with PHP's Maximum execution time of N seconds exceeded and gets 504 whatever status it set, unless its headers were out. A stream ended by a graceful shutdown ends with the fatal error Request cancelled (shutdown): its shutdown functions run and its finally blocks do not. JSON log lines carry the event's fields under fields, and a drain logs Draining in-flight connections and, when requests do not unwind, Forcing shutdown.

  • Documentation: references

    oxphp.stub.php declares float $timeout = 0.0 for the oxphp_async_await*() functions, and null for $attrs of OxPHP\Profile\mark() and $attributes of oxphp_apm_start() and oxphp_apm_event(). Shared\Pool\Stats::idle() counts idle slots on every thread, so acquireTimeout() can time out while idle() is above zero; Shared\Pool has no count() (use Pool::stats()->size()), and every Shared\* constructor throws CapacityException past SHARED_MAX_ENTRIES or SHARED_MAX_BYTES. The tracing reference names the phpredis spans Redis::hGet, Redis::hSet, Redis::lPush and Redis::rPush, and the root span's error.type, oxphp.queue_wait_us and oxphp.php_exec_us. On PHP 8.4 OPcache is a shared extension the image loads, and the image keeps php, docker-php-ext-install and phpize for installing extensions. oxphp config --check parses the configuration and .oxphpdeny, and leaves PHP_DENY_*, SYMLINK_ALLOW_PATHS and plugin settings to startup.

Breaking changes 7

  • oxphp run stays in the starting directory

    A script no longer runs from its own directory, so a relative open such as fopen('config/app.ini') or require './bootstrap.php' now resolves from the directory oxphp was started in; build such paths from __DIR__. A relative script path such as bin/console.php is taken from the working directory and no longer looked up in include_path, and open_basedir applies to what the script includes and opens, not to the script itself. oxphp serve is unchanged.

  • oxphp run takes display_errors from php.ini

    With display_errors=Off, as in a php.ini copied from php.ini-production, run no longer shows a script's errors and leaves them to log_errors; with On they go to standard output, among what the script prints. Pass -d display_errors=stderr, or set display_errors=stderr in the ini file, to keep them on standard error. The image's own ini files do not set it, so without an ini file of your own nothing changes.

  • PHP_BINARY under oxphp run is the oxphp binary

    It used to be an empty string. Symfony's PhpExecutableFinder, PhpSubprocess and PhpProcess, PHPUnit's process isolation and amphp/parallel now start oxphp, where Symfony's finder used to fall back to /usr/local/bin/php. oxphp takes the php options -n, -c, -d, -f and -r and a script on standard input; any other php option, such as -l or -i, is an error. Set the environment variable PHP_BINARY=/usr/local/bin/php to send PhpExecutableFinder back to the php CLI.

  • A task cancels the tasks it did not await

    An oxphp_async() task that ends without awaiting a task it dispatched now cancels it. A child parked in oxphp_sleep() or in an await resumes with OxPHP\Async\AsyncException, and one running on the CPU is interrupted. Await every task whose work has to finish inside the task that dispatched it.

  • More pool callbacks are refused on other threads

    In Worker mode, and for a Shared\Pool created inside an oxphp_async() task, an acquire on a thread other than the creating one (an ASYNC_WORKERS task thread, or another worker for a pool bound with Registry::pool() or kept in a Shared\Map) now throws Error, and a destroy callback is skipped, when the callback calls a method on an object ([$maker, 'make']) even if the method does not use $this, calls a built-in method on an object that is not an OxPHP\Shared one, reaches an enum that opcache.preload does not load, or has code outside OPcache's shared memory (no OPcache, opcache.file_cache_only=1, eval()). These used to run there and could corrupt memory or crash the server. Use a static method ([Maker::class, 'make']) or a closure that builds what it needs, preload the enums such a callback reaches, and keep OPcache enabled. A closure made from a function, make(...), now runs there with that thread's own static variables. Nothing changes on the creating thread.

  • New DOCUMENT_ROOT values

    false, off, 0 or no, in any case, now switch the document root off: every request goes to ENTRY_FILE, and the server refuses to start unless that is an absolute path to a regular file. A value that is not valid UTF-8 now stops startup instead of falling back to the default. An empty DOCUMENT_ROOT= now means the default /var/www/html/public, where the server used to stop at startup.

  • Building the extension from source needs the version

    phpize && ./configure in ext/ reads the server's version from the checkout's Cargo.toml and stops with an error when it cannot. A build that copies only ext/ into a stage of its own has to pass OXPHP_VERSION=<version> to ./configure. phpversion('oxphp_sapi'), ReflectionExtension::getVersion() and oxphp_server_info()['version'] now report that version instead of 0.1.0.

Added 2

  • php options and scripts on standard input

    oxphp takes the php options -n, -c <path>, -f <file> and -r <code>, and a bare oxphp that an oxphp run script started reads its script from standard input, as a bare php does. That is the command line Symfony's PhpSubprocess and PhpProcess and PHPUnit's process isolation give PHP_BINARY, so they now work under run. Each oxphp run sets OXPHP_RUN_PID to its own process id, and a bare oxphp reads standard input only when its parent has that id and its standard input is not a terminal or /dev/null; started any other way, it is the server. A script under run that starts the server should call oxphp serve, because system('oxphp') can still pass the check. -n and -c with nothing to run are an error, as -d is, and code on standard input takes no arguments, so a PHPUnit .phpt test with --ARGS-- and no --STDIN-- fails under run.

  • Running with no document root

    DOCUMENT_ROOT=false (or off, 0, no) sends every request to ENTRY_FILE, which must then be an absolute path. It is meant for an API or a microservice with no static files. A .php entry runs for each request, or serves them as the worker with WORKER_MODE_ENABLED=true; any other file, with or without an extension, is served for every request with the MIME type of its extension (application/octet-stream without one). The router does not look at the path, so /.env, /.git/config or a path that is not valid UTF-8 reach the application, which reads them from $_SERVER['REQUEST_URI']. .oxphpdeny is not read, and PHP_DENY_PATHS, PHP_DENY_FALLBACK, SYMLINK_ALLOW_PATHS and a .oxphpdeny in the entry file's directory are ignored with a startup warning that names them. $_SERVER['DOCUMENT_ROOT'] is the entry file's directory, a symlink in ENTRY_FILE is followed once at startup (so a re-pointed link needs a restart), and /config on the internal server reports the switch as entry_only.

Changed 1

  • display_errors in php.ini now applies under oxphp run

    run used to set its default, display_errors=stderr, over every ini file, so display_errors=Off with log_errors writing to an error_log file still showed each error on standard error as well. The default still applies when no ini file sets display_errors, and none of the image's own files do. On shows errors on standard output, as under php, and -d display_errors=stderr keeps them on standard error whatever the ini files say. The other run defaults, such as max_execution_time=0, are still not changed by php.ini, as under php; the documentation said they were.

Fixed 15

  • Relative script paths under oxphp run

    oxphp run bin/console.php or oxphp ./bin/migrate.php failed with Failed opening required and exit code 255, because the engine changed into the script's directory before opening it. The script now runs in the directory oxphp was started in, also when given by its absolute path, and is opened by the path it was given rather than through include_path. A phar archive is opened again by its path to read the archive, so open_basedir still applies to it, as under php.

  • amphp/parallel under oxphp run

    It starts its workers through PHP_BINARY, which was empty, and failed with Amp\Parallel\Context\ContextException: Starting the process failed. Each worker is now an oxphp run of its own. Under oxphp --user=root run a worker drops to www-data, and the amphp/parallel parent then hangs. run now also looks for php-cli.ini or php.ini in the binary's directory before /usr/local/etc/php.

  • ASYNC_WORKERS under oxphp run

    With ASYNC_WORKERS above 0, every run ended in a segmentation fault (exit code 139) as the async threads started, even for a script that never called oxphp_async(), so a migration or cron job was reported as failed and no task could run. Tasks now run there. One case can still crash the process, even mid-script: a task that leaves behind a closure it created while its code is not in OPcache's shared memory, which under run is every task unless opcache.enable_cli=1 is set. On PHP 8.5, run no longer sets register_argc_argv=1, as PHP 8.5's own php does not.

  • Pool callbacks that crashed other threads

    In Worker mode, and for a Shared\Pool created inside an oxphp_async() task, a factory or destroy callback could crash the server on another PHP thread through the class self, static or parent stands for, a callable naming one of them that it held as a value, an enum, a built-in method called on an object or a built-in static method called on a script class, a method called on an object even without $this, code outside OPcache's shared memory, or the static variables of a closure made from a function. Each is now refused there with an Error from the acquire call, or a skipped destroy callback, and a closure made from a function or a static method runs there as that function, with the thread's own static variables. A callable built at run time from what the callback reads is still not checked; the Shared Pool page lists the gaps.

  • Child tasks left running after their parent

    A task that ended without awaiting a task it dispatched left that child running, and without OPcache the child could execute code the request had already freed. The child is now cancelled when its parent ends. With the code in OPcache's shared memory the parent's result arrives at once; without it the result waits until the child stops, with a warning after a few seconds, and a child that never stops holds it for good.

  • Fiber::suspend() in a task

    A task that called Fiber::suspend() outside a Fiber it started itself ended the whole server with exit code 255, with every request in flight on every worker. It now throws FiberError inside the task, which the task can catch; left uncaught, it fails the task and its awaiter gets OxPHP\Async\AsyncException. A task that catches it and retries without end is ended after a bounded number of attempts.

  • Fiber::suspend() retries in Worker mode

    A request ended for retrying Fiber::suspend() was answered while its finally blocks were still running, and the next request on that worker ran the rest of it in place of its own handler. The response is now sent once the unwind is over. The FiberError a request gets for suspending its own fiber now also points at that call, not at the worker script's oxphp_worker() line.

  • error_get_last() in tasks

    It returned the last error of another task on the same thread, and without OPcache an error raised in a task could outlive the request that dispatched it and make error_get_last() return garbage or crash the server. Each task now keeps its last error to itself. The backtrace PHP 8.5 reports under trace is still kept per thread.

  • Fiber::getCurrent() after a fatal error in a Fiber

    In Worker mode and in tasks it returned null on the request's or task's fiber from then on, later requests included, so libraries that tell concurrent requests apart by their fiber filed them under one key. The record is now put back.

  • static variables in task closures

    A task crashed the server with a segmentation fault on reaching a static whose initializer is a function call or an application constant (static $id = random_int(1, PHP_INT_MAX);, static $n = LIMIT;) when the request had called the closure before dispatching it. Such a static now starts in the task from the value it had then, null included.

  • Destructors that throw or fail during cleanup

    An exception thrown out of a generator's finally block when a task's result or closure is released no longer ends the server with exit code 255. A fatal error in a destructor OxPHP runs while releasing a task's closure, a pool callback or the WeakMap value a Shared\Mutex closure set now ends the request as a fatal error does elsewhere, and OxPHP lets go of what it holds: the mutex no longer stays locked for good, and the pool and Shared objects no longer stay in the registry. A Shared\Pool $destroy exception whose own __destruct() throws no longer crashes the server: the exception the destructor throws is thrown where the slot was dropped.

  • Source arrays in tasks without OPcache

    A task whose code copied an array written in the source changed its reference count from the task's thread and listed it among that thread's garbage roots, which could corrupt memory or crash the server. oxphp_async() now gives such values the form OPcache gives the ones it keeps in shared memory before any task sees them. Code compiled again and again inside a request that does not end and dispatched to a task leaves these values behind each time, until the worker is recycled.

  • request_parse_body() in Worker mode

    Calling it left the earlier parse behind: a buffered copy of the body for the life of the worker, or the temporary files of the uploads on disk for good. They are now released when the request ends. Code PHP runs inside the call, such as an error handler for a urlencoded body over post_max_size, can no longer pause its request either.

  • Pools dropped during idle eviction

    A Shared\Pool whose last reference went away while the idle-eviction scheduler was looking at it was torn down on the scheduler's thread, so its idle slots went without $destroy, counted under oxphp_shared_pool_destroy_skipped_total{reason="other_thread"}, and a connection in one stayed open until its request, or in Worker mode its worker, ended. The thread letting the pool go now calls $destroy.

  • The extension reports the server version

    oxphp_server_info()['version'], phpversion('oxphp_sapi'), ReflectionExtension::getVersion() and the Version row of phpinfo()'s oxphp_sapi section said 0.1.0. They now report the version oxphp --version prints.

Security 1

  • zstd 0.13.4, zstd-safe 7.4.0, zstd-sys 2.1.2

    Closes RUSTSEC-2026-0391, -0398, -0403 and -0410, none of which OxPHP can reach. Every compressed response gets a new one-shot compression context, the seekable feature and legacy-frame decompression are not enabled (OxPHP never decompresses), and the affected allocator shim is built only for WebAssembly. The three crates are now licensed BSD-3-Clause.

Breaking changes 14

  • Deprecated variables are no longer read

    INDEX_FILE, WORKER_FILE, PHP_DENY_DIRS, STATIC_CACHE_TTL, STATIC_CACHE and COMPRESSION_LEVEL are ignored, and nothing warns about one left set. A Framework or Worker deployment still on INDEX_FILE or WORKER_FILE falls back to Traditional mode, where any .php file under the document root runs, and paths listed only in PHP_DENY_DIRS are served again. Move each to ENTRY_FILE (plus WORKER_MODE_ENABLED=true), PHP_DENY_PATHS, STATIC_MAX_AGE, STATIC_REVALIDATE or COMPRESSION_ENCODINGS with COMPRESSION_BROTLI_LEVEL, then check the OxPHP routing mode decided line on the first start.

  • Large responses spool to TMPDIR

    A response that is not streamed and outgrows RESPONSE_BUFFER_BYTES (1 MiB) is written to a temporary file in TMPDIR, or /tmp. On a read-only root filesystem, mount a writable volume and point TMPDIR at it, or every such response is a 503. The files cost disk on a container's writable layer (Kubernetes counts it as ephemeral-storage) and memory on a tmpfs. RESPONSE_SPOOL_MAX_BYTES (1 GiB) caps them all; past it the answer is 503 with Retry-After: 5.

  • Unsuffixed tags move to Alpine 3.24

    :latest, :0.14.0, :0.14.0-php8.4 and every other tag that names no Alpine version are built on Alpine 3.24, and 0.13.0's follow through the weekly rebuild. A Dockerfile that builds extensions on php:<minor>-zts-alpine3.23, or copies OxPHP onto that base, has to move to alpine3.24 or pin :0.14.0-php<minor>-alpine3.23. An intl.so built on 3.23 needs libicuuc.so.76, which 3.24 lacks.

  • Header names with _ or . no longer reach $_SERVER

    An application reading $_SERVER['HTTP_X_API_KEY'] for a client that sends X_Api_Key now finds nothing. Read it with oxphp_http_request()->header('X_Api_Key'), or have the client send X-Api-Key.

  • Repeated header lines are joined

    A header sent as several lines reaches PHP as one value joined with ", ", so behind two proxies HTTP_X_FORWARDED_FOR holds both lines where it used to hold the last. Content-Type, Host and Content-Length take their first line, so HTTP_HOST is now the first Host line. A header with a non-ASCII byte on any of its lines is left out whole.

  • Host from :authority and absolute-form targets

    HTTP_HOST, SERVER_NAME, SERVER_PORT, host(), port() and fullUri() now come from an HTTP/2 request's :authority and from an absolute-form HTTP/1.x target. Browsers reaching OxPHP over HTTP/2 used to arrive with no HTTP_HOST and SERVER_NAME set to localhost. A Host that disagrees with :authority, an empty host or a malformed target (GET index.php, a :path without a leading /, * outside OPTIONS) is a 400 without running PHP.

  • CONNECT answers 501

    It no longer runs PHP or reaches a static file. Requests probing for an open proxy now count in oxphp_responses_by_status_total{status="5xx"} instead of 2xx and, with OTEL_ENABLED, mark their server span as an error, so an error-rate alert built on either can fire for them.

  • Shared\Pool lasts one request outside Worker mode

    With traditional, Framework or SPA routing, Registry::pool() throws OxPHP\Shared\SharedException and a pool closes when the request that created it ends. A connection pool kept across requests this way handed out memory PHP had freed; use PDO::ATTR_PERSISTENT or Worker mode instead. An acquire from another request, from a task or after the end throws ClosedException. oxphp run and Worker mode are unaffected.

  • Pool callbacks on another thread refuse objects

    In Worker mode, and for a pool created in an oxphp_async() task, a factory or destroy callback that another PHP thread runs throws an Error naming the variable when it captured, or keeps in a static, an object, a closure or a resource, or uses $this. Other captured and static values are copied as they were when the pool was created, so a change made in one call is not seen by the next. OxPHP\Shared objects are shared, not copied.

  • Pool callbacks end with the creating request

    In Worker mode and in tasks, once the request that created a pool has ended (its worker recycled, retired or stopped), an acquire that has to make a slot throws ClosedException, and slots other threads destroy go without $destroy and are counted in oxphp_shared_pool_destroy_skipped_total{reason="request_ended"}. A pool bound to a name gets new callbacks from the next Registry::pool() or Registry::global() call.

  • Idle pool slots are evicted in Worker mode

    Shared\Pool now destroys slots left idle longer than idleTimeoutMs and calls $destroy for them, as documented. They used to stay until evict() or the server stopped, connections included. Check the idleTimeoutMs your pools pass; a fatal error in $destroy during this eviction retires the worker.

  • Worker mode undoes putenv() per request

    A value every request should see must be set before oxphp_worker(). One set inside a request, even by a bootstrap that runs lazily on the first request, is gone when that request ends.

  • Worker mode holds one open session at a time

    While a request is paused with its session open (in oxphp_async_await(), oxphp_sleep() or a MySQL or Redis query under RUNTIME_HOOKS), its worker takes no new request and session_start() in its other requests waits. A request that waits with its session open for something only a new request could provide stalls until the session closes. Call session_write_close() once the session data is final and before suspending.

  • Unawaited tasks are cancelled with their request

    An oxphp_async() task the request did not await is interrupted when the request ends, even if it never suspends: at the next point the engine checks for an interrupt, such as a loop's jump back, it is unwound with OxPHP\Async\AsyncException. Work that has to finish must be awaited.

Added 1

  • Debian (glibc) images for tagged releases

    Every release now ships on Debian trixie as well as Alpine, for linux/amd64 and linux/arm64: the release's Alpine tags with -trixie at the end, and :trixie in place of :latest. They are signed with cosign and rebuilt weekly like the Alpine tags; 0.13.0 gets them from that rebuild. Alpine stays the default.

Changed 3

  • A panic in OxPHP aborts the server

    A panic in OxPHP's own code that unwinds a PHP worker thread with a request open, or an async pool thread, now aborts the process with oxphp: thread '<name>' panicked with a PHP request open; aborting. The worker used to be replaced without its request being shut down, and a lost pool thread could leave awaits hanging. No way to trigger such a panic is known. Under PID 1 the container exits with 139, or 134 with docker run --init.

  • Pool $destroy runs only on the owning thread

    It runs on idle-timeout eviction, on evict() and when the last reference goes away, on the thread holding the slot. Slots that leave without it are counted in the new oxphp_shared_pool_destroy_skipped_total (reason no_frame, other_thread or request_ended), and evicted_total{reason="shutdown"} stays at 0. In Worker mode, call $pool->evict() after oxphp_worker() returns to destroy a worker's slots at shutdown.

  • ClosedException is no longer deprecated

    OxPHP\Shared\ClosedException stays as what a Shared\Pool acquire throws on a closed pool, on a pool the call may not use, and when a new slot is needed after the creating request ended. Shared\Channel does not throw it.

Removed 2

  • Warnings for variables that did nothing

    WORKER_MAX_REQUESTS, SHARED_SHUTDOWN_TIMEOUT_SECONDS, SHARED_SOFT_LIMIT_RATIO and SHARED_POISON_STRICT already had no effect; their startup WARN is gone too. Recycle workers with WORKER_MAX_MEMORY_MIB or Worker::scheduleExit(), bound shutdown with DRAIN_TIMEOUT_SECONDS, alert on oxphp_shared_capacity_saturation, and pass Once\FailureMode::Poison where a failed factory must disable a Shared\Once.

  • oxphp_pool_spike_*()

    The undocumented oxphp_pool_spike_capture(), oxphp_pool_spike_invoke() and oxphp_pool_spike_reset() were an internal probe. Called more than once with a callable that reaches __call() or __callStatic(), they ran freed memory.

Fixed 22

  • Exceptions lost behind a hooked MySQL wait

    With RUNTIME_HOOKS including streams, an exception leaving a function whose local pdo_mysql connection had a transaction open, or an unbuffered statement not read to its end, skipped its catch and ran the code after the call. An exit() there let the script carry on. The exception is now set aside during the wait and put back after it.

  • Persistent PDO transactions left open

    On PHP 8.4.27 / 8.5.12 and later with RUNTIME_HOOKS=streams, a request that let go of its PDO handle mid-transaction on a persistent connection other requests' handles shared left the transaction open for the next user of that connection, who could commit it. OxPHP now sends the rollback itself unless the same request still holds and uses another handle on that connection.

  • Running out of memory in Worker mode and tasks

    On PHP 8.4.27 / 8.5.12 and later, a request or task past memory_limit crashed the server on 8.4 and left the worker answering empty responses on 8.5. It now ends in a fatal error, its shutdown functions run and the worker keeps serving. PHP's new hard memory limit is not covered: an allocation past it ends the process with exit code 137.

  • Shared\Pool callbacks on other threads

    A closure run as a factory or destroy callback on a task's thread or another worker's could land in that thread's garbage-collector roots, leave its memory in the creating request's static variables, use classes that do not exist there, or run freed memory through __call(), __callStatic() and [$closure, '__invoke']. Each could crash the server at a later request; the pool now runs its own copy of the callback.

  • Shared\Pool kept past its request

    Outside Worker mode, a pool bound with Registry::pool() or stored in a Shared\Map handed later requests memory PHP had freed and crashed the server on stop (zend_mm_heap corrupted, exit 139). A pool now lasts as long as the request that created it.

  • Shared\Pool teardown across threads

    A pool created in Worker mode or in a task no longer frees idle slots or callbacks into another thread's heap at server stop (docker stop was enough) or when dropped on another thread. A worker that exits now takes its idle slots with it instead of leaving them counted against maxSize.

  • Shared\Pool destroy callback edge cases

    A $destroy run by evict() can now return a slot to its own pool without hanging. A fatal error in it no longer loses the slots not reached yet or leaves a Shared\Map locked, a WeakReference or WeakMap no longer hands it the pool being freed, and a pool dropped while an exception or exit() unwinds now runs $destroy instead of crashing.

  • Shared\Pool acquire no longer holds its thread

    In Worker mode and in tasks, a wait for a slot suspends the request or task and checks for a free slot every few milliseconds. It used to block the thread and could hang when another request on the same worker held the slot. A task cancelled during the wait gets AsyncException.

  • Named arguments skip optional parameters

    new OxPHP\Shared\Pool(factory: $make, maxSize: 8), compareAndSet() given failure: without success:, and oxphp_apm_event() or oxphp_apm_status() given span_id: no longer throw ArgumentCountError. ReflectionParameter::getDefaultValue() returns those defaults.

  • Task closures bound to $this

    The task's $this was a proxy built in the dispatching request's memory, which a task outliving that request could read after it was freed. The pool thread now builds the proxy itself, and dispatching no longer raises Deprecated: Creation of dynamic property OxPHP\Async\BorrowedProxy::$promiseId.

  • Tasks abandoned by a blocking await timeout

    A blocking oxphp_async_await() or oxphp_async_await_all() that timed out let the end of the request release what the task captured while it could still be running. Such a task is now drained like the ones race() and any() abandon, which can hold a classic-mode response until the task stops.

  • Tasks running freed code without OPcache

    A task still running after the drain budget, whose closure was not in OPcache's shared memory, could execute code the request had already freed. It is now waited for until it stops, with a warning once the budget runs out; a task that never stops keeps its worker from finishing.

  • Graceful shutdown with queued tasks

    In Worker mode with ASYNC_WORKERS set, a queued task that never started as the async pool stopped made its worker wait on a timer that was already shut down, and the process aborted with [CRASH] SIGABRT (exit 139). The wait now ends when the pool stops.

  • Streaming flushes and slow clients

    In Worker mode, a flush waiting for a slow client (its 64-chunk queue full) suspends the request like oxphp_sleep() instead of holding the worker thread and every request on it. In every mode that wait now ends at max_execution_time and when a graceful shutdown begins.

  • Tasks calling their own script's functions

    A task, or a pool callback on a thread that never loaded its file, that called a function declared in that file or declared a class crashed the whole server. It is now refused with an Error naming the file and line. Functions and classes loaded by opcache.preload exist on every thread.

  • OPcache tables on async threads

    A task or pool callback running code OPcache cached after its thread started could read and write past the end of that thread's table ([CRASH] SIGSEGV or SIGBUS). The thread now grows its table before running the code.

  • Worker::current() outside Worker mode

    It returned the instance from an earlier request on the same thread, in memory PHP had already freed, which could crash the server. Each request now gets its own.

  • Values held past a drained request

    In Worker mode with ASYNC_WORKERS set, a value that a drained request's shutdown function was waiting for, and any Shared object with it, stayed alive until the worker thread exited. It is now released when its request ends.

  • Await timeouts too large for a deadline

    INF, 1e300 or PHP_INT_MAX passed to oxphp_async_await() or its variants aborted the server, or on arm64 timed out at once. A timeout now sets a limit only when it is above 0 and at most 1e9 seconds (about 31.7 years); anything else waits without one.

  • Dockerfiles for PHP 8.4 in the docs

    The Installation and Docker guide examples built on php:8.4-zts-alpine now take OxPHP from the -php8.4 tag instead of the PHP 8.5 default, and the minimal one installs libgcc, which the oxphp binary needs.

  • Documentation on what can take the server down

    The docs no longer say a fatal error in one request cannot take the server down. PHP's hard memory limit and native crashes (segfaults, bus errors) end the whole process; a Docker guide section covers memory_hard_limit_percent; the oxphp run exit codes list 137; and a Worker-mode recycle cancels the requests the worker was serving.

  • Request and pool reference corrections

    $request->headers() keys are lowercase. A Shared\Pool destroy callback's exception is swallowed, not logged, and evict() drops only the calling thread's idle slots. oxphp.stub.php no longer marks PoisonedException deprecated or says ClosedException comes from channels.

Security 7

  • Worker mode: putenv() leaked across requests

    A value one request set with putenv(), such as a client's token, was read through getenv() and inherited by child processes in every later request on every worker until that worker was recycled. It is now put back when the request ends, as in traditional mode.

  • Slow HTTP/1.1 readers held whole bodies in memory

    Over HTTP/1.1 the server read a static file or streamed response as fast as it could, whatever the client took: ten requests for a 500 MiB file read at 1 MiB/s took a container past a 6 GiB memory limit in two seconds. It now stops reading while the write buffer is full, as it already did over HTTP/2.

  • Buffered responses held until the client finished

    A script's output stayed in memory, outside memory_limit, until the last byte was read, so ten slow downloads through readfile() of a 500 MiB file pinned about 5 GiB. Output past RESPONSE_BUFFER_BYTES now goes to a temporary file, and RESPONSE_SPOOL_MAX_BYTES caps the total.

  • Header names with _ or . spoofed $_SERVER keys

    X_Forwarded_For and X.Authenticated.User arrived as HTTP_X_FORWARDED_FOR and HTTP_X_AUTHENTICATED_USER, replacing or creating a key a proxy sets, unless the proxy stripped them (nginx does). Such headers no longer reach $_SERVER.

  • Worker mode: requests ran in another client's session

    A request taken or resumed while another client's request was paused with its session open got that session. After session_write_close(), the next session_start() could take the closed session's id and send it back in a Set-Cookie, signing one client in as another. A request's session now travels with it.

  • Worker mode: URL rewriter and SID across requests

    Links rewritten for session.use_trans_sid or output_add_rewrite_var() could carry the session id of a request served while another was paused, and SID could name another request's session. Both now travel with the request.

  • rustls 0.23.46, rustls-webpki 0.103.16, tokio 1.53.3

    Closes RUSTSEC-2026-0349 (GHSA-w44r-93j7-qv28) and RUSTSEC-2026-0382 (CVE-2026-111943) in the connections OxPHP opens. The OTLP exporters and PROFILER_EXPORT_URL could accept a chain through a distrusted emSign intermediate, and profiler exports could be steered off X25519MLKEM768. The server's own TLS listener was not affected. tokio closes RUSTSEC-2026-0386, in code OxPHP does not call.

Breaking changes 11

  • Worker mode: max_execution_time per request

    A request the worker takes while carrying others now gets its own limit, counted from when it was taken, and set_time_limit() affects only the request that calls it. An SSE stream or long poll that lived on the shared timer must call set_time_limit(0) itself; the release image ships no php.ini, so the limit is 30 s.

  • RUNTIME_HOOKS=1, true and all include net

    Connects, TLS handshakes and reads, writes waiting for buffer room, and unix://, udp:// and udg:// reads park the fiber on upgrade, with no edit of your own. runtime_hooks now reports ["sleep","streams","net"], and a stream shared between fibers is guarded whatever its transport. RUNTIME_HOOKS=sleep,streams keeps the old set.

  • Shareable is reserved for the Shared types

    A PHP class can no longer implement OxPHP\Shared\Shareable or extend a Shared type, now final; both are fatal at declaration. Passing such an object to another thread used to crash the server. PHPUnit createMock() of a Shared type or of Shareable now fails; use a marker interface of your own.

  • Shared\* observability aliases removed

    oxphp_shared_channel_pending and oxphp_shared_pool_size leave /metrics, and pending/size leave type_specific at /__ox_shared/entry, along with the startup WARN that announced them. Dashboards and alerts must switch to oxphp_shared_channel_count, oxphp_shared_pool_count and count.

  • TRUSTED_PROXIES reads IP:port entries

    Behind a load balancer that writes IP:port into X-Forwarded-For (Azure Application Gateway), REMOTE_ADDR is now the client and REMOTE_PORT its port. Where a CDN in front of such a gateway also appends, the address is now the CDN's own; list its ranges too (for Cloudflare, the cloudflare keyword).

  • DOCUMENT_ROOT behind a release symlink

    The root is resolved once at startup and every static file read from disk and every PHP script is checked against it when opened, so once /app/current is switched they answer 404 until the server restarts. Point DOCUMENT_ROOT at a path that does not change across releases, or restart as part of the switch.

  • Scripts the server cannot open

    Outside worker mode a deleted script answers 404 even where OPcache holds it with validate_timestamps off, so a deploy that deletes and recreates files in place (git checkout, rsync --delete) has a 404 window; write new files beside the old and rename over them. An unreadable script answers 500 and logs Cannot open script.

  • Symlinked scripts run as their target

    Outside worker mode a script reached through a link into another directory runs with that directory as its working directory, and whether PHP treats it as a phar depends on the resolved file name, not the URL. Build relative paths from __DIR__.

  • fiber.stack_size must clear zend.reserved_stack_size

    In worker mode and ASYNC_WORKERS tasks the fiber stack limit now keeps PHP's reserve (48 KiB in a release build) free, so a fiber.stack_size at or below it fails every request with Maximum call stack size of 0 bytes, and deep recursion stops 44 KiB sooner than before.

  • Profile\start() does nothing while the profiler is disabled

    It no longer makes Profile\is_active() return true with PROFILER_ENABLED off, so a test that starts a profile and asserts is_active() needs the profiler enabled. With OTEL_APM_ENABLED, the APM spans the call used to discard are now kept in the trace.

  • UploadedFile::type() after moveTo() reads the destination

    Type detection no longer runs before the move, so a file moved on, deleted or rewritten by the time type() is first called reports what is there now, or application/octet-stream with a warning. Call type() before moveTo() where the moved file does not stay put or sits behind a stream wrapper.

Added 8

  • .oxphpdeny path deny rules

    A .gitignore-syntax file at the top of DOCUMENT_ROOT keeps the paths it lists from being served, in every routing mode, for static files and PHP alike, before any disk access. Denied paths answer PHP_DENY_FALLBACK and a > rule hands the request to the entry script. Read once at startup; denials count in oxphp_path_deny_total.

  • RUNTIME_HOOKS=net

    Connects through PHP's stream transports, TLS handshakes and reads, writes waiting for room in the send buffer, and reads on unix://, udp://, udg:// and socket-pair streams suspend the fiber instead of holding the worker thread. Needs streams listed too and runs on Linux only. Not covered: libcurl, libpq, libmemcached, DNS and persistent connects.

  • TRUSTED_PROXIES cloudflare keyword

    Keywords, CIDRs and bare IPs now mix in one list (private,100.64.0.0/10 used to be a startup error). cloudflare trusts Cloudflare's edge ranges and reads the client address from CF-Connecting-IP when the first hop past your own proxies is a Cloudflare edge; private,cloudflare fits Cloudflare → load balancer → OxPHP.

  • User-Agent in traces and access logs

    The root server span carries user_agent.original and each access-log entry a user_agent field, cut to 512 bytes with invalid UTF-8 replaced, so a crawler can be told apart from a browser by its traces alone.

  • Why a request was shed

    The overload log lines now split refusals into refused_queue_full, refused_wait_timeout, refused_waiting_full and refused_waiting_bytes, and the root span of a refused request carries oxphp.shed_reason, so the limit to raise is visible without the INTERNAL_ADDR listener.

  • OTLP export failures in /metrics

    oxphp_otel_export_failures_total, oxphp_otel_export_failed_spans_total and oxphp_otel_export_retries_total count failed exports, the spans they carried and fast-failure retries. A failed export is also logged as OTLP span export failed with the batch size and cause.

  • CPU count at startup

    A CPU count for default sizing line reports cpus, cpu_source (host, affinity, cgroup quota or unknown), host_cpus and the resulting PHP_WORKERS and TOKIO_WORKERS. cpu_source=host on a plan sold as fewer CPUs, as seen on DigitalOcean App Platform under gVisor, means both should be set explicitly.

  • Debian (glibc) nightly image

    :nightly-trixie, :php8.4-nightly-trixie and :php8.5-nightly-trixie run the same server on php:<minor>-zts-trixie and used 14 to 19% less CPU per response than Alpine on a Yii3 app. www-data is UID 33 there and extensions build in a trixie stage; tagged releases stay on Alpine.

Performance 1

  • Cheaper PHP function calls

    The engine observer that counted every call, internal ones included, for the stuck-request classification is gone. On a Yii3 app CPU per request drops 5% in classic mode and 7% in worker mode; a script making 15 000 short calls per request uses 23 to 25% less.

Fixed 22

  • APM: phpredis hGet, hSet, lPush and rPush

    With OTEL_APM_ENABLED on, these four returned NULL without reaching Redis: writes were lost and reads came back empty, with no error and no span. The hook now matches method names case-insensitively, as PHP does.

  • PHP 8.5: memory_limit after an out-of-memory error

    A deep-stack OOM in worker mode or an async task left the worker enforcing no limit at all, so the next runaway request grew until the kernel killed the server and every worker in it. The limit is restored as the request ends, and a worker still over it is recycled.

  • Call-stack overflow no longer segfaults

    Recursion reaching PHP's stack limit in worker mode or an async task ends in the usual Error instead of taking the server down; realpath() on the last allowed level was enough. The limit is now the one PHP sets for every fiber.

  • Worker mode: fatal errors inside a Fiber

    A fatal in a fiber the request started, or in a destructor the garbage collector ran, read freed call frames and could crash the process with every connection. The request now ends with a 500 and the worker keeps serving.

  • Worker mode: timeouts end the right request

    The one timer per thread ended whichever request was running and counted the request it was meant for as a handler failure, recycling the worker after three. Each request now has its own deadline; one that passes while suspended ends it with a 504 that does not count toward recycling.

  • Worker mode: max_input_time after boot

    With max_execution_time = 0 and max_input_time set, the timer armed for the worker's boot ended a request max_input_time seconds later (60 under PHP's shipped php.ini templates). The worker now stops it before serving.

  • Async tasks and the pool thread's deadline

    A pool thread's single timer ran out once, about max_execution_time into the process, ending whichever task was running with Maximum execution time of 0 seconds. Pool threads now hold no deadline, so set_time_limit() no longer bounds a task: bound it with the timeout of oxphp_async_await().

  • Persistent connections closed on worker exit

    Every worker-mode recycle and dynamic-pool scale-down left PDO::ATTR_PERSISTENT, mysqli p: and pfsockopen() connections open until the process restarted, piling up until the database refused new clients. They are now closed after the thread's last request.

  • Worker mode: memory left by cancelled internal calls

    A request ended inside an internal function (usort() mid-comparator, say) leaked what that function allocated for the life of the worker. A worker that grew by more than 4 MiB across such a request is now recycled at its next idle moment, with a warning.

  • Fatal errors inside Shared callables

    A fatal in Mutex::withLock(), Once::getOrInit(), a Registry factory or Pool::with() left the mutex locked, the Once pending, the key stuck in creation or the pool one slot short for the life of the process. All of it is given back as the request ends.

  • RUNTIME_HOOKS=streams with APM

    APM's wrappers for PDO, mysqli and Redis skipped the connection guard, so fibers sharing a connection could read each other's Redis replies or get Cannot execute queries while other unbuffered queries are active. The wrappers now call the guarded handler.

  • RUNTIME_HOOKS=streams: destructors between requests

    A destructor run by the worker loop's cycle collection could write into another request's exchange on a shared connection and read its reply. A socket wait on a connection whose holder is parked on it now fails at once, like a timeout, and sends nothing.

  • Persistent PDO constructors wait per data source

    A constructor stuck on a database that never answers held every other persistent constructor on the worker until their wait ran out and they went ahead unserialised. They now wait only for constructors to the same DSN.

  • Dropping a PDO handle on a shared persistent connection

    With RUNTIME_HOOKS=streams, one request releasing its handle rolled back another request's transaction and, with pdo_mysql, could free a result mid-read and segfault. Only the connection's current holder now runs that cleanup, and PDO::rollBack() from another fiber sends nothing.

  • Planned recycles are not crashes

    A worker recycled on WORKER_MAX_MEMORY_MIB or Worker::scheduleExit() is logged at INFO as Worker mode thread recycled, with the reason, instead of a Dead workers detected WARN that read as a crash.

  • OTLP export over http/protobuf

    Not one span was ever exported over that protocol: the export thread panicked and every span logged Spans are being emitted even after Shutdown. Spans now reach /v1/traces under OTEL_EXPORTER_OTLP_ENDPOINT, which is a base URL; drop a /v1/traces already on it.

  • OTLP over gRPC: connects and dead connections

    OTEL_EXPORTER_OTLP_TIMEOUT now bounds connecting too, and on Linux a connection that stops taking data is replaced instead of failing every export for about 15 minutes. An export that fails fast on an idle-dropped connection is sent once more. A set but empty OTEL_EXPORTER_OTLP_ENDPOINT is now refused at startup.

  • oxphp_worker_stuck_total classification

    A PHP loop with no calls in it read as c_call, and a stuck request's first reading could be measured against an earlier request's. The supervisor now asks the engine itself, through the interrupt max_execution_time is delivered by.

  • UploadedFile::moveTo() without fileinfo

    Without mime_content_type(), or under an error handler that turns warnings into exceptions, moveTo() threw before moving and the upload was deleted at the end of the request. It now moves first and leaves type detection to type().

  • Destructor exceptions as an async task ends

    An exception thrown by a destructor freed during task teardown disappeared without a word; it is now reported as uncaught and reaches the error log.

  • Profiler index.json records user_agent

    The documented field was always null.

  • Documentation: SSE guide

    The worker-mode example read events with BRPOP, so each event reached one client; it now reads a Redis Stream and resumes from Last-Event-ID. The guide no longer claims a while (!connection_aborted()) loop ends through its condition, and its example calls ignore_user_abort(true) and set_time_limit(0).

Security 5

  • Static files: symlinks repointed after routing

    A link inside DOCUMENT_ROOT validated on one request and repointed afterwards, at /etc/passwd say, was followed on the next. Files are now checked after they are opened, against the location the kernel reports for the descriptor; a file still in the in-memory cache keeps its validated bytes.

  • PHP scripts: symlinks repointed after routing

    Outside worker mode such a link could run an attacker's script, print a text file or hang a worker on a FIFO once PHP's realpath cache let go of the old target. The worker now opens the script itself, checks the descriptor and hands PHP that file; a swapped link answers 404. About 3% of throughput on a trivial script.

  • PHP 8.5: error_get_last() across requests

    In worker mode and async tasks, a request paused at a suspension point could read another request's fatal-error backtrace, with the arguments its functions were called with: passwords, tokens, customer records. Each request now keeps its own backtrace and lets go of it as it ends.

  • TRUSTED_PROXIES: unparseable forwarding entries

    The rightmost-non-trusted rule skipped entries it could not parse and read on into what the client wrote, so behind a gateway that writes IP:port the client chose its own address. An unparseable entry or unreadable header line now stops the rule.

  • Split Cookie headers

    Cookies split across several field lines, as HTTP/2 allows, are now joined per RFC 9113 before anything reads them. A plugin's __oxp_* cookie on a later line used to reach the application, and stripping one from the first line dropped the application's own cookies on the rest.

Breaking changes 12

  • SHARED_ENABLED=false now disables Shared\*

    The setting used to be parsed and ignored; now no OxPHP\Shared\* class is registered and the first one constructed throws Error: Class "OxPHP\Shared\Counter" not found. It is also read as OX_SHARED_ENABLED and a bare ENABLED, so check all three before upgrading; class_exists() tells code which way it runs.

  • Worker mode: a client hang-up no longer ends the request

    The handler runs to its end so its finally blocks and cleanup run, as if ignore_user_abort were always on; bounded only by max_execution_time. Call connection_aborted() to stop early. Streaming responses are still ended at their next write.

  • ignore_user_abort(true) runs to the end in every mode

    As under PHP-FPM, output is discarded and connection_aborted() reports the disconnect; a stream loop that relied on its next write to stop must check connection_aborted(). ignore_user_abort = On in php.ini or a worker bootstrap now applies to every stream.

  • /health answers 503 when the pool is lost or wedged

    The body gains pool_stalled and reports "status": "degraded". A Kubernetes liveness probe pointed at the aggregate /health will now restart pods; use /health/liveness, /health/readiness and /health/startup.

  • ACCESS_LOG is no longer overruled by LOG_LEVEL

    ACCESS_LOG=all with LOG_LEVEL=warn used to write nothing; it now writes one line per request, so size the log volume. RUST_LOG=warn,access_log=off still silences the access log alone.

  • payload() returns form bodies and JSON scalars

    Form bodies now parse with SUPERGLOBALS_ENABLED=false, and a JSON body of "hi", 42 or false returns that value instead of null or $default. null now means only an empty body, an unparsed Content-Type, invalid JSON or a literal null.

  • Client hang-ups counted as cancellations

    oxphp_request_cancelled_total{reason="client_abort"} starts climbing while admission_refused_total{reason="wait_timeout"} steps down, and the Connection error ERROR line for a client that hung up is now debug; alerts on either should be revisited.

  • Profile runs filed by trigger, under their own run id

    oxphp_profiler_runs_total{source} now splits into header, cookie, query, sample and the new sdk; run ids take the form <ts_ms>-<req_id_prefix>-<rand4>, so /__profiler/runs/{id} answers 404 for a request id; look it up by request_id in /__profiler/runs instead.

  • PROFILER_MAX_DEPTH is enforced

    It used to apply nowhere. The default is now 0 (no limit); values above 32 are clamped with a startup WARN, and calls below the limit are absent from the profile.

  • COMPRESSION_LEVEL deprecated

    Use COMPRESSION_BROTLI_LEVEL; the old name still works with a startup WARN. A non-zero value no longer means Brotli-only, since Zstandard and gzip are now offered too. /config reports brotli_level, gzip_level and zstd_level instead of compression_level.

  • SHARED_SOFT_LIMIT_RATIO and SHARED_POISON_STRICT ignored

    Neither was ever read; both now log a startup WARN, and limits.soft_ratio and diagnostics.poison_strict are gone from /__ox_shared/summary. Alert on oxphp_shared_capacity_saturation; a terminal Once takes Once\FailureMode::Poison.

  • oxphp_queue_wait_us reads lower

    It now stops when a worker takes the request, about 0.1 ms less per request; sub-millisecond alert thresholds fire less readily. oxphp_request_duration_us is unchanged.

Added 9

  • Zstandard compression

    Dynamic responses go out as zstd (level 6) to clients that accept it: smaller than Brotli at under half the CPU. COMPRESSION_ENCODINGS (default br,zstd,gzip, or off) picks the codings, with COMPRESSION_BROTLI_LEVEL (5), COMPRESSION_ZSTD_LEVEL (6) and COMPRESSION_GZIP_LEVEL (6).

  • gzip for clients without Brotli

    Plain-HTTP Chromium and most CLI tools used to get uncompressed bodies. Accept-Encoding is now ranked by q-value per RFC 9110, with q=0 honoured as a refusal; as a result compressible files under 3 MiB answer Range requests with a full 200.

  • Precompressed static cache

    A cached static file gets a maximum-quality Brotli copy built once in the background, 8 to 12% smaller than the per-request output, within the same cache budget.

  • Pool-stall visibility

    oxphp_pool_stalled, oxphp_queue_depth, oxphp_queue_capacity and oxphp_admission_slots_available expose a pool that has stopped taking work off its queue, with a WARN while it lasts and an INFO once work moves again (worker mode).

  • Overload in the log

    Requests shed with 529 now produce a WARN per episode, repeated at most once a minute, and an INFO with the total once a minute passes without refusals.

  • MAX_CONNECTIONS exhaustion reported

    A parked accept loop logs a WARN naming MAX_CONNECTIONS and an INFO when it resumes; oxphp_accept_stalled and oxphp_accept_stalls_total export it.

  • oxphp_admission_wait_wasted_total

    Counts wait_timeout refusals during which no worker started any request, the sign that QUEUE_WAIT_TIMEOUT_MS is too long or the app calls back into its own server.

  • oxphp_worker_request_fibers_active

    Request fibers per worker: 256 means the worker has stopped taking work, and a count that does not return to 0 at idle is a fiber leak (worker mode).

  • RUNTIME_HOOKS visible

    /config and oxphp_server_info() report runtime_hooks as the parsed list of installed categories, e.g. ["sleep","streams"], so a misspelled variable reads as [].

Changed 3

  • Adaptive queue wait budget

    QUEUE_WAIT_TIMEOUT_MS is now a ceiling: the server halves the wait while a quarter or more of started work went to clients that had left (floor 10 ms or 1/64 of the ceiling) and restores it once the queue drains. oxphp_admission_wait_budget_us, oxphp_admission_wait_budget_ceiling_us and oxphp_abandoned_work_total expose it.

  • Brotli per-request quality 5

    Up from 4, which produced larger output than gzip at more CPU; Brotli bodies over 4 KB now compress on the blocking pool. COMPRESSION_BROTLI_LEVEL=4 restores the old behavior.

  • Connection-end log levels by error type

    A client closing the connection is debug, a server-enforced timeout stays warn, and anything else stays error, instead of being decided by the word "timeout" in the message.

Fixed 23

  • Worker mode: sessions leaked between requests

    A request admitted while another was suspended started inside its predecessor's session, and after session_write_close() could adopt its id and receive it in Set-Cookie. The session is now written, closed and $_SESSION removed before every request.

  • Persistent connections answering the wrong request

    Outside worker mode a client abort could end a request between sending a command on pfsockopen() or persistent Predis and reading the reply, desyncing the connection until restart. A departed client is now acted on only at the next write, as under PHP-FPM.

  • Worker mode: pages changing composition after aborts

    Aborted requests skipped finally blocks and, when caught at an opcode boundary, disabled every destructor on the worker, so recursion guards stayed set and pages silently lost blocks. Requests now run to their end.

  • Worker mode: per-request ini values

    Changes made with ini_set(), ignore_user_abort() or error_reporting() no longer leak to requests running beside them or outlive a busy worker; they travel with a suspended request and are restored when it ends. A request also no longer starts at the error_reporting level the previous request on its fiber left.

  • Persistent PDO under RUNTIME_HOOKS=streams

    Overlapping PDO::ATTR_PERSISTENT constructors no longer close a connection under the request using it (fatal error or segfault), and a query during another request's liveness ping no longer kills the connection with 2006 MySQL server has gone away.

  • Worker mode: fatals no longer spin a worker forever

    With the profiler or #[Trace] enabled, two fatals on one worker could loop the observer chain at 100% CPU while the pool looked idle. A fatal raised during recovery from another no longer drops every request on the worker either.

  • Worker mode: uncaught exceptions with __destruct

    An exception class with a destructor turned a 500 into a fatal that counted toward recycling (31 requests retired 8 workers), disabled all destructors on the worker and leaked the exception.

  • Worker mode: client hang-ups no longer recycle workers

    Aborts after ignore_user_abort() or during pickup read as fatals and rotated the pool three at a time. Each request the breaker counts now logs a WARN, and a breaker exit is logged at WARN.

  • Worker mode: streams ended by a write

    Such a stream no longer leaks its frames' variables for the life of the worker, and a fatal in a destructor during that cleanup now counts toward the error breaker.

  • QUEUE_WAIT_TIMEOUT_MS bounds queued requests

    The budget was checked only when a worker picked a request up, so a stalled pool never answered queued requests; they now get 529 with Retry-After: 3 at the deadline.

  • Departed clients no longer queued or refused

    Worker mode no longer runs a request whose client left while it was queued, and a budget that runs out after the client left answers 499 as a cancellation rather than 529. client_abort now counts clients leaving before a worker picked them up.

  • /health/readiness reflects pool health

    The executor check always passed; a pool with no live worker threads, or wedged for a minute in worker mode, now answers 503. Overload still does not.

  • oxphp_apm_trace() runs its callback

    It returned null without calling it. The callback now runs in a child span, receives the span id and returns its value, with the return type now mixed.

  • Error-class messages lost

    TypeError, ValueError and the rest of the Error hierarchy reached spans and Once poison reasons without their message and code.

  • mixed return types under JIT

    Functions like oxphp_async_await() and Shared\Map::get() declared a malformed mixed type, so hot loops under the tracing JIT leaked every returned value and Reflection getReturnType() segfaulted.

  • oxphp_worker_memory_bytes reports memory

    It read 0 forever; it now reports the same PHP heap WORKER_MAX_MEMORY_MIB is checked against, sampled at the end of each request.

  • Worker mode: profiles mixed across requests

    Suspended requests on one thread shared profiler and APM span state, producing profiles and #[Trace]/#[SlowThreshold] spans attributed to the wrong request; each request now carries its own.

  • Profiler truncation and OXPROF

    Runs that hit PROFILER_MAX_SPANS are flagged truncated in index.json, /__profiler/stats and oxphp_profiler_truncated_total, and the documented OXPROF cookie now starts a run.

  • Shared\Mutex::withLock() waits can be ended

    A request waiting on a lock now yields to max_execution_time, shutdown and task cancellation every 100 ms, so opposite-order locking no longer holds two workers until restart.

  • RUNTIME_HOOKS=streams and late-loaded extensions

    mysqli and phpredis enabled from an ini file sorting after extension.ini are now guarded like any other; RUNTIME_HOOKS is also read once at startup instead of via an unlocked getenv() per request.

  • Compression edge cases

    Static files between 1 MiB and 3 MiB are compressed; mixed-case Content-Type values compress; identity copies of compressible responses carry Vary: Accept-Encoding; and non-UTF-8 compression settings fail at startup.

  • Shared\Counter, Atomic and Flag capacity errors

    Their constructors now throw Shared\CapacityException past SHARED_MAX_ENTRIES or SHARED_MAX_BYTES, like every other Shared type.

  • Documentation corrections

    SHARED_LOCK_DIAGNOSTICS values are off, warn (default) and strict; worker recycling by request count is no longer advertised; the worker loop also exits on dynamic-pool retirement; 504 comes from max_execution_time; plus graceful-shutdown bounds, the runtime image's ini layout and /config key order.

Security 1

  • rustls 0.23.45

    Fixes a TLS 1.3 handshake flaw (RUSTSEC-2026-0285) that accepted plaintext handshake messages across an encryption boundary, affecting the TLS listener and the OTLP and profiler exporters; the transcript stays authenticated.

Breaking changes 5

  • FRAME_OPTIONS defaults to SAMEORIGIN

    Cross-origin framing stays blocked and same-origin embedding (admin previews, dashboard widgets) works out of the box; deployments that relied on the built-in DENY must now set it explicitly.

  • Worker mode: no event loop inside a request

    A worker-mode request is now a fiber, and Revolt refuses to run its loop within one: Revolt\EventLoop::run() in a handler throws. Move it to the worker bootstrap; defer(), delay() and getSuspension() keep working.

  • Worker mode: request state ends with the request

    ini_set(), set_time_limit() and error_reporting() roll back to the bootstrap baseline between requests; filter_input() answers only for the request asking; a php://input handle kept past its request reads as a closed resource instead of another request's body.

  • query() and cookie() decode their values

    Code that compensated with rawurldecode() now decodes twice and must drop the extra call. A cookie sent empty reads as an empty string rather than null, and query() parses at most 1000 parameters.

  • Strict MAX_CONNECTIONS / QUEUE_CAPACITY parsing

    Malformed values abort startup instead of silently falling back to defaults, and QUEUE_CAPACITY=0 now means auto (workers × 128) instead of a zero-capacity queue.

Added 5

  • Queue wait budget

    A request arriving at a full queue now waits for a slot up to QUEUE_WAIT_TIMEOUT_MS (default 1 s) instead of an instant 529; one deadline stamped on arrival covers the wait for a slot and in the queue. QUEUE_MAX_WAITING and QUEUE_MAX_WAITING_BYTES bound the waiting set in requests and in body bytes.

  • RUNTIME_HOOKS=streams

    Blocking tcp:// socket reads and stream_select() suspend the fiber instead of the worker thread, covering mysqlnd (PDO_MySQL, mysqli), phpredis and the HTTP stream wrappers with no code changes. Connections shared between concurrent fibers are claimed per exchange, so requests cannot read each other's replies.

  • oxphp_admission_refused_total

    Requests shed before reaching a worker now leave a server-side trace, with a reason label separating the four overload reasons (529) from shutting_down (503) and pool_unavailable (500).

  • Automatic root-span exception capture

    An unhandled exception or fatal that answers 5xx attaches an exception event (type, message, stacktrace, file, line) to the request's root span in all four serving modes, with no attribute or oxphp_apm_error() call required.

  • Database span attributes

    PDO and mysqli spans carry db.statement (literal values obfuscated to ?), db.operation, db.system, server.address/port, db.name and oxphp.db.slow; mysqli_stmt::prepare joins the hooked set as function number 34.

Changed 4

  • oxphp_queue_wait_us reaches one second

    Four new buckets (100 ms to 1 s) quantify waits near the default budget instead of lumping them into +Inf; refused requests are excluded from the histogram.

  • Worker recycling counts what wrecks the worker

    Only fatals, out-of-memory and stack overflows count toward the three-consecutive-failures recycle; uncaught exceptions and cancelled requests are neutral. The breaker now trips on the synchronous dispatch path too, where it never fired.

  • config --check sizing advisory

    Warns, without failing, when PHP_WORKERS + QUEUE_CAPACITY + QUEUE_MAX_WAITING reaches MAX_CONNECTIONS, the point past which overload answers nothing instead of 529.

  • Documentation flattened

    The repository docs moved from docs/en/ up to docs/; the Russian and Chinese translations moved to oxphp.dev, where French, Polish and Japanese already live.

Fixed 8

  • Worker mode: $_POST and $_FILES populated

    Both were empty for every request a worker ever served, so HTML forms and file uploads silently did not work; JSON APIs reading php://input were unaffected, which is why it stayed hidden.

  • filter_input() cross-request leak

    The filter extension's own input copy accumulated for the life of the worker, answering one request with another client's query values, session cookies and body fields; it is now given back at the start of every request.

  • Sleep timer bursts

    More than 32 timers expiring in one scheduler poll left the extra sleepers parked forever; a large burst now wakes in batches of 32.

  • Closing a shared connection

    fclose(), $mysqli->close() or a reconnect helper on a connection another request was parked reading resumed that request into freed memory; it now fails immediately with a 500 naming what happened.

  • Fatals no longer wipe shared state

    Unwinding an aborted request double-released include variables, silently resetting the arrays and objects worker-mode applications keep their cross-request state in.

  • Async pool pacing

    Task handoffs are no longer paced by the fixed 1 ms idle timer: a Shared\Channel transfer dropped from 0.69 ms to 0.14 ms per item, and idle wakeups from 777/s to 92/s.

  • Paused requests keep their start time

    $request->startTime() and oxphp_server_info()[request_time] no longer read 0 or a concurrent request's value after a suspension.

  • Body-read warnings reach the right request

    post_max_size and upload-limit warnings now fire inside the request that sent the body, so error handlers see its superglobals, and one that throws answers 500 instead of closing the connection with nothing.

Breaking changes 5

  • Privilege drop by default

    Started as root where a www-data account exists, the server binds its listeners and drops to www-data before serving any traffic; the official image no longer runs as root. Pass --user=root to keep the old behavior.

  • Fail-closed TLS config

    A half-configured pair (TLS_CERT without TLS_KEY, or vice versa) or a non-UTF-8 cert/key value now aborts startup instead of silently serving plain HTTP, naming the offending variable.

  • Strict ASYNC_* / SUPERGLOBALS parsing

    Garbage in ASYNC_WORKERS, ASYNC_QUEUE_CAPACITY or ASYNC_MAX_FIBERS is a startup error instead of a silent default, and oxphp run no longer ignores an invalid SUPERGLOBALS_ENABLED.

  • QUERY without Content-Type returns 400, not 415

    The only server-generated 415 is gone; a custom ERROR_PAGES_DIR/415.html for this case must be renamed to 400.html.

  • Profiler export envelope resolution

    PROFILER_EXPORT_XHGUI=false now wins even on a /run/import URL, and envelope auto-detection keys only on each tool's canonical path (xhgui /run/import, Buggregator /api/profiler/store), no longer on a fuzzy "xhgui" substring.

Added 5

  • Buggregator profiler export

    The profiler's HTTP push wraps xhprof data in the envelope Buggregator's POST /api/profiler/store expects; PROFILER_EXPORT_BUGGREGATOR toggles it, with tags and app_name set via env.

  • OTLP trace export over TLS

    An https:// OTEL_EXPORTER_OTLP_ENDPOINT is now exported encrypted on both gRPC and http/protobuf, verified against the system trust store via rustls; the runtime image must ship a CA bundle (the official one does).

  • Full exception data on APM spans

    The exception span event now carries exception.message and exception.stacktrace alongside exception.type, so New Relic Errors Inbox, Jaeger and Tempo render the message and stack; capped by OTEL_APM_MESSAGE_MAX_BYTES / OTEL_APM_STACKTRACE_MAX_BYTES.

  • Graceful drain of long-lived connections

    On SIGTERM the server sends GOAWAY, closes idle keep-alives and ends open SSE/flush streams promptly; DRAIN_TIMEOUT_SECONDS default lowered 30 → 25 to fit Kubernetes' 30s grace period.

  • TLS_MIN_VERSION

    Minimum accepted protocol version: 1.2 (default) or 1.3. Anything else, including a foreign syntax like "TLSv1.2", is a hard startup error, validated even when TLS is disabled and reported as tls_min_version in /config.

Changed 2

  • Cheap STATIC_REVALIDATE

    stat() at most once every 3 seconds per file; a static hit is served from memory with at most one syscall, and on-disk changes become visible within 3s. Default stays off.

  • Clearer TLS startup errors

    A typo'd path fails with "TLS_CERT: cannot read /etc/ssl/cert.pem: No such file or directory" instead of a bare OS error; PEM-parse and key-mismatch errors are prefixed the same way.

Fixed 2

  • Worker-mode cancellation targeting

    A client abort or request timeout could cancel whichever request was most recently accepted on the worker instead of the one actually being cancelled, aborting an unrelated in-flight request.

  • finish_request() vs multiplexed streams

    Once any request on a worker called oxphp_finish_request(), every other stream multiplexed onto that worker silently dropped its subsequent oxphp_stream_flush() output.

Breaking changes 1

  • Timed-out await cancels the task

    An abandoned task is force-cancelled: parked tasks resume into cancellation, CPU-bound ones are interrupted at an opcode boundary. Previously it ran to request end.

Added 4

  • Nested oxphp_async()

    An async task can dispatch tasks of its own and suspend on await_all / await_any / await_race without blocking its worker thread. The "no nested async" restriction is gone.

  • In-flight task cap

    ASYNC_MAX_FIBERS (default 256) bounds queued + running tasks; dispatch past the cap rejects immediately with AsyncException, so fan-out cannot deadlock.

  • Internal server allow-list

    INTERNAL_ALLOW_IPS: a CIDR allow-list for /metrics and /config; health endpoints stay reachable for orchestrators.

  • Profiler sampling excludes

    PROFILER_EXCLUDE_PATHS keeps framework self-traffic (/_profiler, /_wdt) out of statistical sampling; explicit triggers still profile.

Fixed 2

  • Channel sender wake-up

    A fiber send-waiter parked on a full Shared\Channel wakes when recv_blocking frees a slot, so sendTimeout no longer trips spuriously under saturation.

  • Async edge cases

    A graceful-shutdown crash; await on a closed promise stalling instead of rejecting; await_all leaving promises running on early bail-out.

Breaking changes 2

  • Worker routing contract

    Static assets come from disk and everything else goes to the worker ENTRY_FILE. Arbitrary .php files, directory indexes and the root index.php fallback are no longer resolved per-request.

  • Honest CGI PATH_INFO

    In Framework mode PATH_INFO is set only for an explicit /index.php/extra request; PHP_SELF reports the front controller. Route on REQUEST_URI.

Added 2

  • Range requests (RFC 9110)

    206 Partial Content for static files: video seeking, resumable downloads, partial PDF loading; If-Range honored with strong validators.

  • HTTP/2 connection limits

    Five env vars bound per-connection resource use; resolved values are logged at startup.

Changed 1

  • Strong static ETags

    "<size>-<mtime>" replaces W/"…" (If-Range requires a strong tag); compressed representations keep a weak tag.

Fixed 2

  • Application headers win

    X-Content-Type-Options, X-Frame-Options and CSP set from PHP are no longer overwritten. Server values are insert-if-absent fallbacks.

  • Streaming vs compression

    flush()-streamed responses pass through uncompressed instead of being buffered in full by the brotli layer until script end.

Security 1

  • HTTP/2 DoS hardening

    Rapid Reset (CVE-2023-44487), HPACK bombs and window-stall attacks are bounded; dead connections reclaimed via PING/PONG keepalive.

Breaking changes 1

  • remote_ip in access logs

    The JSON field remote_addr is renamed remote_ip and carries the IP without a port, as nginx/Apache/Caddy do.

Added 3

  • PHP-style CLI

    oxphp run script.php executes a file under CLI semantics with the full engine underneath; #!/usr/bin/env oxphp scripts run directly; -d ini overrides accepted.

  • --user privilege drop

    Bind privileged ports as root, then irreversibly drop to an unprivileged user before any request-handling thread spawns.

  • Forwarded port honored

    Behind TRUSTED_PROXIES, SERVER_PORT honors X-Forwarded-Port; REMOTE_PORT is filled from RFC 7239 for= when the proxy supplies one.

Fixed 3

  • Decorator crashes

    Two SIGSEGV in the function-decorator path (freed instance cache; dangling zval across resize) are gone; nesting overflow now throws StackOverflowException.

  • Profiler attributes honor arguments

    #[SlowThreshold(ms:)], #[MemoryThreshold(kb:)] and #[Mark(label:)] no longer collapse to shared defaults; APM span events reach OpenTelemetry.

  • Upload object API wired

    Request::file() / files() return UploadedFile objects for every $_FILES shape instead of null.

Breaking changes 4

  • Trichotomous wait API

    Channel and Mutex split every wait into try* / bare verb / *Timeout(int $ms), returning value-typed SendResult / RecvResult instead of mixed|null.

  • await_any means Promise.any

    First fulfilled wins; all-rejected throws AggregateAsyncException. The old "first settled" behavior is now oxphp_async_await_race().

  • Honest cancel statuses

    Timeout → 504, graceful drain → 503 + Retry-After, client disconnect → 499 (log-only). Supervisor kills and userland cancels keep 500.

  • Renames without shims

    Async\Exception → AsyncException, Shared\Exception → SharedException; Worker drops get* prefixes; Counter goes minimal (add/set); Flag mirrors Atomic; Once gains getOrInit()/status().

Added 2

  • Shared\Atomic + Ordering

    A generic int64 atomic: load/store/swap/CAS/fetch* with explicit memory orderings, one-to-one with std::sync::atomic.

  • Shared\Registry

    Name-keyed process-global handles: every worker converges on the same entry; the factory runs at most once.

Removed 1

  • One timeout source

    REQUEST_TIMEOUT_SECONDS and oxphp_request_heartbeat() are gone; max_execution_time and set_time_limit() remain.

Fixed 1

  • connection_aborted() in SSE

    Returns true after a mid-stream disconnect, so while (!connection_aborted()) loops exit cleanly.

Performance 1

  • Shared\* hot path

    Per-op overhead lands within criterion noise of a raw atomic load; ≈4.7× geomean at 8 threads vs the previous shape.

Breaking changes 1

  • Strict boolean env parsing

    Only on/true/1/yes and off/false/0/no; a typo like ture refuses to start instead of silently defaulting.

Added 2

  • ENTRY_FILE + WORKER_MODE_ENABLED

    One variable selects the routing mode by extension; an explicit toggle enables persistent workers. INDEX_FILE / WORKER_FILE become deprecated aliases.

  • OxPHP\Server\Worker class

    A runtime introspection handle (id, request count, memory, RSS) plus application-driven recycling via scheduleExit().

Changed 1

  • Static cache renames

    STATIC_CACHE_TTL → STATIC_MAX_AGE; STATIC_CACHE → STATIC_REVALIDATE with flipped polarity. Defaults unchanged.

Deprecated 1

  • WORKER_MAX_REQUESTS

    Parsed and ignored with a startup WARN. Migrate to WORKER_MAX_MEMORY_MIB or scheduleExit().

0.4.0

Release notes

Added 1

  • PHP 8.5 images

    :php8.5, :php8.5-alpine and patch-pinned tags ship alongside 8.4; latest stays on 8.4 until the soak window closes.

Fixed 4

  • Chunked streaming across requests

    The bridge's per-request context leaked between worker requests, dropping chunked Transfer-Encoding after the first flush.

  • Shared\* inside user fibers

    Channel::recv()/send() inside Fiber::start() no longer take the oxphp-fiber suspend path and crash with fiber_await rc=1.

  • Named arguments for the plugin API

    Plugin-defined classes and functions now advertise real parameter names, so named-argument calls work.

  • Shared handles in async closures

    Channel/Map/Pool captured by an oxphp_async() closure no longer arrive as null on the receiving thread.

Breaking changes 1

  • Async namespace

    Async classes moved under OxPHP\Async\; the functions now ship in plugin-async.

Added 4

  • Seven Shared\* primitives

    Atomic state shared across workers (Counter, Flag, Once, Mutex, Channel, Map, Pool), with registry observability and a deadlock detector.

  • Per-request profiler

    xhprof / speedscope / pprof / collapsed outputs; cookie, header, query and statistical triggers; HTTP push with an xhgui envelope.

  • APM auto-instrumentation

    plugin-apm with a PHP tracing SDK and error capture; the async and APM subsystems moved into Rust plugins.

  • Production integrations

    TRUSTED_PROXIES (RFC 7239), Kubernetes /readyz + /livez, security headers and per-IP rate limiting, all env-configured.

Performance 1

  • Pool hot path

    Uncontested acquire/release ≈0.9 µs in Docker, with per-thread affinity.

Added 3

  • Fiber multiplexing

    Concurrent I/O within a single worker thread; distributed tracing with W3C Trace Context and OpenTelemetry export.

  • oxphp_async() promises

    Parallel PHP execution on a dedicated thread pool.

  • HTTP object API

    OxPHP\Http\Request with lazy accessors, plus the attribute-based decorator system.

Changed 1

  • Port and backpressure

    Default port 8080 → 80 (443 with TLS); the backpressure response 503 → 529.

Fixed 1

  • CGI correctness

    SERVER_PROTOCOL reflects the real HTTP version; REQUEST_TIME is request start; IPv6 Host parsing; 408 on request timeout.

0.1.0

Release notes

Added 5

  • Async HTTP core

    A Hyper + Tokio server with graceful shutdown, a custom oxphp SAPI with full superglobals, a ZTS worker pool with a bounded queue and 529 backpressure.

  • Three routing modes

    Traditional, Framework and SPA; static files with an in-memory cache, ETag/304, brotli, TLS.

  • Worker mode

    Persistent workers via oxphp_worker(), early response completion, SSE streaming, cooperative timeouts.

  • Observability

    /metrics, /health, /config, structured JSON access logs, request IDs.

  • Docker-first

    A multi-stage Alpine build; amd64/arm64 images on GHCR.