Skip to content

CLI

phpray is the operator's command-line interface, installed by install.sh or the manual install. All commands talk to the local collector over its API ([api].bind).

Commands

phpray status

One-line health of everything: which PHP versions have the extension and which mode they run in, collector up/down, shm size and usage, dashboard URL, and — when [cloud] is configured — the connection state (connected as <server>, plan, quota used). Use it first when anything looks wrong (see Troubleshooting).

phpray top

Live view of the slowest requests and the hottest components across all sites, updating every second. Equivalent to the dashboard overview but for a terminal; Ctrl-C to quit, --site <host> to filter.

phpray trace <domain>

Recent traces for one site (docroot/host):

phpray trace shop.example --level alert --since 1h --limit 20
phpray trace shop.example --uri /checkout/ -o jsonl     # export

Flags: --level normal|full|alert, --since, --uri, --limit, -o jsonl to emit raw records (same format as the file output).

phpray diag <domain>

Diagnose why a site shows nothing or wrong things: is the extension loaded in the PHP that serves it, is phpray.enabled effective, is the URI in ignore_uris, is the mode manual with no trigger, is shm writable, is the collector reading the same shm path the extension writes to. Prints the resolved INI for that docroot and the verdict for each check.

phpray report

Generate a text/JSON summary for the last period — the thing you attach to a bug report (see Troubleshooting): extension versions per SAPI, config dump, collector version, retention usage, recent alert count. phpray report -o report.txt.

Exit codes

0 ok, 1 collector unreachable, 2 extension not loaded in any PHP, 3 auth error — handy for monitoring scripts.