> ## Documentation Index
> Fetch the complete documentation index at: https://help.noxity.io/llms.txt
> Use this file to discover all available pages before exploring further.

# X-Ray App

> Profile slow PHP requests at the function-call level. Find the exact line that's eating your TTFB.

X-Ray is a CloudLinux PHP profiler. You point it at a URL on one of your domains, it captures the next handful of requests to that URL, and it reports back which function calls are responsible for the slow time. Closer to a flamegraph than a log dump.

It's the right tool when "the site is slow" and you need to know *why*, not just that it is.

<Frame caption="cPanel home → Software → X-Ray App">
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/noxity/images/cpanel/software/php-xray/page-light.png" alt="X-Ray app with tracing tasks list and Start Tracing button" className="block dark:hidden" />

  <img src="https://mintlify.s3.us-west-1.amazonaws.com/noxity/images/cpanel/software/php-xray/page-dark.png" alt="X-Ray app with tracing tasks list and Start Tracing button" className="hidden dark:block" />
</Frame>

## When to use it

* A specific URL is slow. Not the whole site, just one page.
* You've ruled out database connectivity (the [Resource Usage](/web-hosting/cpanel/metrics-analytics/resource-usage) IO column is fine) and want to know which PHP code is slow.
* A plugin update broke performance and you can't tell which one without measurement.

For account-wide resource pressure, look at [Resource Usage](/web-hosting/cpanel/metrics-analytics/resource-usage) instead. X-Ray is for tracing one URL pattern.

## Start a trace

<Steps>
  <Step title="Click Start Tracing">
    Top-right of the page. The **Start tracing** dialog opens.

    <Frame>
      <img src="https://mintlify.s3.us-west-1.amazonaws.com/noxity/images/cpanel/software/php-xray/start-tracing-light.png" alt="Start tracing dialog with Choose domain and Specify mask fields" className="block dark:hidden" />

      <img src="https://mintlify.s3.us-west-1.amazonaws.com/noxity/images/cpanel/software/php-xray/start-tracing-dark.png" alt="Start tracing dialog with Choose domain and Specify mask fields" className="hidden dark:block" />
    </Frame>
  </Step>

  <Step title="Pick the domain">
    Click **Choose domain** and pick one of the domains on your account. X-Ray can only trace requests routed through the cPanel-managed PHP handler, so add-on and primary domains both work.
  </Step>

  <Step title="Specify the URL mask">
    The **Specify mask** field is the path you want to trace. Examples:

    | Mask                       | Matches                  |
    | -------------------------- | ------------------------ |
    | `/`                        | The homepage only        |
    | `/checkout`                | Exactly `/checkout`      |
    | `/blog/*`                  | Anything under `/blog/`  |
    | `/wp-admin/admin-ajax.php` | Exact admin-ajax handler |

    The **How to use special characters?** link in the dialog covers wildcards. `*` matches any path segment.
  </Step>

  <Step title="Pick how long to trace">
    **Record for** has two modes:

    | Mode              | What it does                                                      | When to use                                                       |
    | ----------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
    | **Request**       | Capture the next *N* requests to the mask, then stop. Default 20. | When you can hit the URL yourself or there's predictable traffic. |
    | **Time interval** | Capture every request to the mask for *N* hours, up to 48.        | When the slow page is rare and you don't know when it'll fire.    |
  </Step>

  <Step title="(Optional) Open Advanced settings">
    Tick the **Advanced settings** box for finer control. The most useful options:

    * **Slow request threshold**: only record requests that took longer than the threshold. Default is the system slow-request limit.
    * **PHP version**: trace only requests handled by a specific PHP version (useful when migrating).
  </Step>

  <Step title="Click Run">
    The task appears in the Tracing tasks list with status **Running**. Generate the traffic (refresh the URL, run the slow checkout, whatever it takes) until X-Ray's collected enough samples.
  </Step>
</Steps>

## Read the report

When the task finishes, click its row to open the report. The page shows three things:

* **Summary**: average and slowest request times across the captured samples.
* **Function call list**: a table of every PHP function called during the slow request, with cumulative time spent in each. Sortable by time-spent-descending; the worst offender ends up at the top.
* **Slow function flag**: any function over a threshold gets a red dot. Click for the call stack that led to it.

A typical bad result looks like:

| Function        | Calls | Time     |
| --------------- | ----- | -------- |
| `mysqli_query`  | 412   | 4,820 ms |
| `wp_cache_get`  | 1,103 | 380 ms   |
| `apply_filters` | 5,221 | 220 ms   |

That tells you the page is making 412 queries, almost certainly an N+1 in a plugin. Time to dig into which call site is responsible.

## What X-Ray can't do

* **No view into MySQL internals.** It tells you `mysqli_query` is slow, but not whether it's the network, the query plan, or the locks. For that you need slow-query logs (open a ticket if you need them turned on).
* **No view into JavaScript or browser rendering.** X-Ray is a server-side PHP profiler. Front-end performance needs Chrome DevTools or a real-user-monitoring tool.
* **No view into background jobs.** Cron jobs, queue workers, and other non-HTTP PHP runs aren't traceable through this UI.

## Common gotchas

<AccordionGroup>
  <Accordion title="Task started but no data is being captured">
    Either the URL mask doesn't match any traffic, or the requests aren't going through the PHP handler. Check by hitting the URL yourself in a browser; the task should pick it up within a few seconds. If the URL is served by a static cache (AccelerateWP page cache, Cloudflare cache, etc.) PHP is never invoked, so X-Ray sees nothing. Bypass the cache temporarily to trace.
  </Accordion>

  <Accordion title="The report says 'No slow requests detected'">
    Either the page actually isn't slow under your test conditions (try a logged-in scenario, a cold cache, real DB load) or the slow-request threshold in Advanced settings is set too high. Lower the threshold to capture every request, then sort by time.
  </Accordion>

  <Accordion title="I want to keep tracing day after day automatically">
    The **Continuous tracing** tab is available to administrators only on shared hosting. End-users can't create continuous tasks. Workaround: set up a recurring tracing task (Time interval mode, 48 hours) and re-run it.
  </Accordion>

  <Accordion title="Conflict warning when starting a new task">
    Either you already have a running task for that domain/URL, or an administrator-level continuous task is running. Wait for it to finish or check the Tracing tasks list and stop the existing one.
  </Accordion>
</AccordionGroup>

## Need a hand?

<CardGroup cols={2}>
  <Card title="Open a ticket" icon="life-ring" href="https://members.noxity.io/submitticket.php">
    Best for anything that needs an account check or a config change on our end.
  </Card>

  <Card title="Live chat" icon="messages" href="https://noxity.io/contact">
    Faster for quick questions during business hours.
  </Card>
</CardGroup>
