Every setting is one environment variable
The one exception is an optional file, .oxphpdeny, for path deny rules. Each variable has a default, so the server starts with an empty environment and you override only what you need.
Boolean values
| truthy | on | true | 1 | yes |
|---|---|---|---|---|
| falsy | off | false | 0 | no |
Anything outside this set, such as the typo "ture", fails fast at startup with an error that names the variable. Empty equals unset: FOO=${FOO} substitutions that produce FOO= fall back to the default instead of refusing to start.
No variables match your filter.
Server & workers
15 variables
0.0.0.0:80Address and port for the main HTTP server.
/var/www/html/publicRoot directory for serving files and PHP scripts. false (or off, 0, no, in any case) switches it off: every request goes to ENTRY_FILE and no static files are served. An empty value means the default.
Single canonical entry script. Unset or a name without an extension = direct file mapping, *.php = front controller, any other extension = SPA fallback; with worker mode, the worker bootstrap. Resolved against DOCUMENT_ROOT, and must be an absolute path when DOCUMENT_ROOT is switched off.
falseEnable persistent worker mode. Requires ENTRY_FILE pointing at a .php script.
10000Maximum concurrent TCP connections. Also the ceiling for the default QUEUE_MAX_WAITING (half of it); a malformed value is a startup error. Keep it above PHP_WORKERS + QUEUE_CAPACITY + QUEUE_MAX_WAITING.
CPU / 2 (min 1)Async I/O threads. 1 = single-threaded, N = fixed count, unset = auto. Shares cores with PHP_WORKERS, so raising it to the full core count usually costs throughput. CPU counts the cores the process may run on (affinity mask, lowered to a cgroup quota), not a CPU weight or a limit a platform enforces outside the container; the startup line CPU count for default sizing shows what was counted.
sapiPHP executor backend: sapi for real PHP, stub for benchmarking without PHP.
CPU / 2 (min 1)Worker pool size. N = fixed pool, MIN:MAX = dynamic scaling, 0 = auto. Auto sizing counts CPUs as TOKIO_WORKERS does. On a plan whose CPU limit the container cannot see (cpu_source: host in the startup log), set both explicitly.
30Seconds a dynamic worker stays idle before being retired. Retirement waits for a moment with nothing in flight, so in-flight requests are never cut short.
workers × 128Max pending requests in the PHP queue; arrivals at a full queue wait up to QUEUE_WAIT_TIMEOUT_MS. 0 = auto. For MIN:MAX pools, initial workers = the minimum.
1000Ceiling on how long a request may wait for a PHP worker before a 529. One deadline covers the wait for a queue slot and the wait in the queue. Under overload the server shortens it on its own (down to 1/64, min 10 ms); oxphp_admission_wait_budget_us shows what is in force. 0 = reject the moment the queue is full.
workers × 128, ≤ MAX_CONNECTIONS / 2Max requests parked waiting for a queue slot; past it, immediate 529. Each waiter holds a connection and its buffered body. 0 = auto.
64 MiBMax request-body bytes held by the waiting set; a body that would exceed it gets an immediate 529, bodyless requests keep waiting. 0 = auto.
0Memory ceiling per worker in MiB before recycling. 0 = unlimited. Workers also recycle after three consecutive requests that came apart, or on demand via Worker::scheduleExit().
trueBuild $_SERVER and $_GET before each script. Falsy skips that work; $_POST, $_FILES, $_COOKIE and php://input are unaffected.
Traffic & delivery
20 variables
5Max seconds to receive HTTP headers after connect (Slowloris protection).
25Max seconds for in-flight requests during graceful shutdown; stragglers are then cancelled. A request stuck in a blocking call can hold the process past it.
0 (off)Max requests per IP per window. 0 = off; a full PHP queue answers 529.
60Rate-limit window duration in seconds.
Path to the PEM certificate. Both TLS_CERT and TLS_KEY must be set to enable TLS.
Path to the PEM private key.
1.2Minimum TLS version: 1.2 or 1.3. Validated at startup even when TLS is off.
PHP_WORKERS_MAX × 4 (min 32)Max simultaneous open streams per connection.
20Max queued RST_STREAM frames before the connection is closed (Rapid Reset protection).
65536Max total decoded header bytes per request.
20Seconds between PING frames; 0 disables.
10Seconds to wait for a PING reply before closing the connection.
30dCache-Control: max-age for static files. Accepts 30s, 5m, 2h, 30d, 1w, 1y, bare seconds or off.
offmtime revalidation for the in-memory cache, checked at most every 3 s per file.
br,zstd,gzipContent codings offered: br, zstd, gzip. off/none disables compression. Order is ignored: cached static files prefer Brotli, everything else zstd.
5Brotli quality 0 to 11; 0 withdraws Brotli.
6Zstandard level 0 to 19; 0 withdraws zstd. Out-of-range values abort startup.
6Gzip level 0 to 9; 0 withdraws gzip. Out-of-range values abort startup.
1 MiBOutput of a buffered (not streamed) response kept in memory. Past it the response moves to a temporary file in TMPDIR, or /tmp, and is sent from there. 0 = default.
1 GiBTotal size all spool files may reach. A response that would pass it, or cannot be written to disk, is answered with 503 and Retry-After: 5. On a read-only root filesystem, point TMPDIR at a writable volume. 0 = default.
Security
5 variables
SAMEORIGINClickjacking protection: SAMEORIGIN, DENY or off. Sets X-Frame-Options + CSP frame-ancestors on every response; application-set headers always win. Invalid values fall back to SAMEORIGIN with a startup warning.
Trusted proxies: a comma-separated mix of CIDRs, bare IPs and the keywords private and cloudflare. Real client IP from Forwarded / X-Forwarded-* via rightmost-non-trusted; with cloudflare, from CF-Connecting-IP when the request came through a Cloudflare edge.
Glob patterns whose .php files never execute via direct URI (/uploads/**). Matched before disk I/O, so there is no existence oracle.
404Response on a PHP_DENY_PATHS match or a .oxphpdeny deny rule: an HTTP status from 400 to 599 or a /-prefixed PHP fallback script inside DOCUMENT_ROOT. In worker mode .oxphpdeny deny rules take a status code only.
Absolute paths under which symlinks may escape DOCUMENT_ROOT. Unset = no escapes allowed.
Logs, traces & profiles
35 variables
infoLog verbosity of the server's own diagnostics: trace, debug, info, warn, error. Does not filter the access log; client disconnects log at debug.
Per-request access log: all = every request, error = 4xx/5xx only, unset = off.
Internal server (/health, /metrics, /config). Port-only values bind 127.0.0.1; unset = not started.
CIDR allow-list for the internal server; outsiders get 403, health probes stay reachable. Loopback is not implicit.
Directory with custom {status}.html error pages.
524288Max body bytes for internal query endpoints (512 KiB).
falseW3C Trace Context propagation: reads traceparent/tracestate and forwards them to PHP via $_SERVER.
falseEnable OpenTelemetry span export. Implies TRACE_CONTEXT=true.
grpcExport protocol: grpc or http/protobuf.
localhost:4317 / 4318OTLP collector endpoint. With http/protobuf it is a base URL: spans are sent to /v1/traces under it.
10000Export timeout in milliseconds. Over gRPC it also bounds connecting to the collector, TLS handshake included, and on Linux sets how soon a connection that stopped taking data is closed.
Authentication headers: key=value,key2=value2.
oxphpService name in exported spans.
Service version attribute.
Extra resource attributes: env=prod,region=us-east-1.
parentbased_traceidratioSampling strategy: always_on, always_off, traceidratio and the parentbased_* variants.
1.0Sampling ratio from 0.0 to 1.0 for ratio-based samplers; out-of-range values are clamped.
falseAPM: auto-instrumentation of 34 PHP functions (PDO, mysqli, cURL, Redis…), error capture, tracing SDK. Requires OTEL_ENABLED. When off, oxphp_apm_trace() still runs its callback.
100Slow-query threshold in ms; slower DB queries get oxphp.db.slow=true.
falseRecord bind parameters in db.params spans. Recorded raw (not obfuscated), so this can put PII in traces. Enable it only where that is acceptable.
8192Cap on the exception.stacktrace attribute; truncated from the tail. 0 = no truncation.
4096Cap on the exception.message attribute (New Relic's per-attribute limit); truncated from the tail. 0 = no truncation.
falseMaster switch. Only this and PROFILER_EXCLUDE_PATHS stop startup on a bad value, even with the profiler off. A number in another PROFILER_* var that does not parse silently takes its default.
0.0Probability (0.0 to 1.0) that a request is sampled.
Glob patterns (PHP_DENY_PATHS syntax) kept out of sampling, such as /_profiler,/_profiler/**,/_wdt/**. The X-OxPHP-Profile header still profiles them.
Secret the X-OxPHP-Profile header must carry, and bearer for /__profiler/*. Unset = no token. Sampling and OxPHP\Profile\* functions never check it.
50000Per-request span cap; longer profiles are truncated.
0 (no cap)Max nesting depth of recorded calls; deeper calls' time folds into the call at the limit. Clamped to 32.
/tmp/oxphp-profilesDirectory for on-disk profiles.
xhprof,collapsedFormats written to disk: xhprof, collapsed. An unknown name is skipped with a startup warning, and a list with no known name writes both. An empty value turns disk output off.
10Rate limit on profile files written per second.
100Max profile files kept; older ones are pruned.
Remote endpoint to POST each profile to. Disk output carries on unless PROFILER_OUTPUT_FORMATS is empty.
xhprofWire format for exports: xhprof or collapsed, sent as is with no wrapper. An unknown value falls back to xhprof with a startup warning.
Bearer token sent with each export.
Example configurations
Starting points straight from the docs. Copy one and adjust.
# verbose logs while you build and debugLOG_LEVEL=debug# record every request, not just errorsACCESS_LOG=all# one worker: deterministic, breakpoint-friendlyPHP_WORKERS=1# local /health, /metrics and /config endpointsINTERNAL_ADDR=127.0.0.1:9090# re-read edited static files without a restartSTATIC_REVALIDATE=on
# route every request through one front controllerENTRY_FILE=index.php# quieter logs: warnings and errors onlyLOG_LEVEL=warn# log only failed requests (4xx/5xx)ACCESS_LOG=error# /health, /metrics, /config on localhost onlyINTERNAL_ADDR=127.0.0.1:9090# 100 requests per IP per window, for abuse protectionRATE_LIMIT=100# behind a proxy, trust private nets for the real client IPTRUSTED_PROXIES=private
Inspect the live configuration
With the internal server running, /config returns the resolved configuration as JSON. TLS paths, INTERNAL_ADDR and ERROR_PAGES_DIR are scrubbed from the response.
curl -s http://localhost:9090/config | jq .