How to Trace Exceptions inside PHP Applications (using OpenResty XRay)

Опубликовано: 01 Июнь 2026
на канале: OpenResty
583
17

Try out OpenResty XRay for free: https://openresty.com/en/xray/

In this tutorial, we will walk through how to use OpenResty XRay to detect and analyze the exceptions in the PHP applications online. OpenResty XRay offers the capability to detect and analyze exceptions or panics in online PHP processes, including caught ones that do not lead to process crashes. Notably, OpenResty XRay can even detect exceptions that have been caught and handled by the application itself, greatly enhancing problem diagnosis capabilities. The code paths are obtained by OpenResty XRay automatically analyzing and interpreting the PHP code-level Exception Flame Graphs. It will minimize the performance impact. This makes it ideal for production environments sensitive to performance overhead and latency.

Text version of this tutorial: https://blog.openresty.com/en/php-exc...

OpenResty XRay is a dynamic-tracing product that automatically analyzes your running applications to troubleshoot performance problems, behavioral issues, and security vulnerabilities with actionable suggestions.

Under the hood, OpenResty XRay is powered by our Y language, targeting various runtimes like Stap+, eBPF+, GDB, and ODB, depending on the context.

OpenResty XRay is a truly non-intrusive dynamic analysis, which does not require installing any special modules or plugins in the target application, does not require recompiling the target application, and does not even require restarting the running process.

Music: https://www.bensound.com