# Reference: runtime type php

URL: https://scalws.com/docs/reference/runtime-php/
Source: `docs/reference/schema` in the ScalWS repository

<h3 id="tenants-.applications-.routes-.runtime.php.fastcgi"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.fastcgi</code></h3>

| | |
|---|---|
| Syntax | `fastcgi: <string>` |
| Default | `none` |
| Context | `tenants[].applications[].routes[].runtime (type: php)` |
| Reload | applies on reload |

External pool: `unix:/path.sock` or `tcp:host:port`. Mutually exclusive with `fpm`.


<h3 id="tenants-.applications-.routes-.runtime.php.fpm"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.fpm</code></h3>

| | |
|---|---|
| Syntax | `fpm: {...}` |
| Default | `none` |
| Context | `tenants[].applications[].routes[].runtime (type: php)` |
| Reload | applies on reload |

Managed PHP-FPM pool settings (workers, ini values); not used with `fastcgi`.


<h3 id="tenants-.applications-.routes-.runtime.php.fpm.binary"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.fpm.binary</code></h3>

| | |
|---|---|
| Syntax | `binary: <string>` |
| Default | `none` |
| Context | `tenants[].applications[].routes[].runtime<php>.fpm` |
| Reload | applies on reload |

PHP-FPM binary; default: `php-fpm` on `PATH`, else the newest versioned one (`php-fpm8.4`, Alpine's `php-fpm84`).


<h3 id="tenants-.applications-.routes-.runtime.php.fpm.env"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.fpm.env</code></h3>

| | |
|---|---|
| Syntax | `env: {<key>: <string>, ...}` |
| Default | `empty` |
| Context | `tenants[].applications[].routes[].runtime<php>.fpm` |
| Reload | applies on reload |

Environment passed to PHP (`env[...]`).


<h3 id="tenants-.applications-.routes-.runtime.php.fpm.ini"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.fpm.ini</code></h3>

| | |
|---|---|
| Syntax | `ini: {<key>: <string>, ...}` |
| Default | `empty` |
| Context | `tenants[].applications[].routes[].runtime<php>.fpm` |
| Reload | applies on reload |

`php_admin_value[...]` settings, e.g. `memory_limit: 256M`.


<h3 id="tenants-.applications-.routes-.runtime.php.fpm.max_requests"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.fpm.max_requests</code></h3>

| | |
|---|---|
| Syntax | `max_requests: <integer>` |
| Default | `500` |
| Context | `tenants[].applications[].routes[].runtime<php>.fpm` |
| Reload | applies on reload |

`pm.max_requests`; 0 disables recycling.


<h3 id="tenants-.applications-.routes-.runtime.php.fpm.workers"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.fpm.workers</code></h3>

| | |
|---|---|
| Syntax | `workers: {...}` |
| Default | `none` |
| Context | `tenants[].applications[].routes[].runtime<php>.fpm` |
| Reload | applies on reload |

`min` = `pm.start_servers`/`pm.min_spare_servers`, `max` = `pm.max_children`.


<h3 id="tenants-.applications-.routes-.runtime.php.fpm.workers.autoscale"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.fpm.workers.autoscale</code></h3>

| | |
|---|---|
| Syntax | `autoscale: off \| auto \| recommend` |
| Default | `recommend` |
| Context | `tenants[].applications[].routes[].runtime<php>.fpm.workers` |
| Reload | applies on reload |

`off`, `recommend` (default) or `auto` (ADR-0014).


<h3 id="tenants-.applications-.routes-.runtime.php.fpm.workers.max"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.fpm.workers.max</code></h3>

| | |
|---|---|
| Syntax | `max: <integer>` |
| Default | `required` |
| Context | `tenants[].applications[].routes[].runtime<php>.fpm.workers` |
| Reload | applies on reload |

Upper bound when the pool is scaled.


<h3 id="tenants-.applications-.routes-.runtime.php.fpm.workers.min"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.fpm.workers.min</code></h3>

| | |
|---|---|
| Syntax | `min: <integer>` |
| Default | `required` |
| Context | `tenants[].applications[].routes[].runtime<php>.fpm.workers` |
| Reload | applies on reload |

Processes started at the beginning and kept at least.


<h3 id="tenants-.applications-.routes-.runtime.php.fpm.workers.target_concurrency"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.fpm.workers.target_concurrency</code></h3>

| | |
|---|---|
| Syntax | `target_concurrency: <integer>` |
| Default | `none` |
| Context | `tenants[].applications[].routes[].runtime<php>.fpm.workers` |
| Reload | applies on reload |

Concurrent requests one worker is expected to handle well (utilisation basis).


<h3 id="tenants-.applications-.routes-.runtime.php.front_controller"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.front_controller</code></h3>

| | |
|---|---|
| Syntax | `front_controller: <string>` |
| Default | `none` |
| Context | `tenants[].applications[].routes[].runtime (type: php)` |
| Reload | applies on reload |

Script that handles requests for paths that do not exist, e.g. `/index.php`.


<h3 id="tenants-.applications-.routes-.runtime.php.index"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.index</code></h3>

| | |
|---|---|
| Syntax | `index: [<string>, ...]` |
| Default | `["index.php","index.html"]` |
| Context | `tenants[].applications[].routes[].runtime (type: php)` |
| Reload | applies on reload |

Index files for directory requests, tried in order.


<h3 id="tenants-.applications-.routes-.runtime.php.response_timeout"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.response_timeout</code></h3>

| | |
|---|---|
| Syntax | `response_timeout: <duration> (e.g. 30s)` |
| Default | `60s` |
| Context | `tenants[].applications[].routes[].runtime (type: php)` |
| Reload | applies on reload |

Time to wait for PHP-FPM's response headers.


<h3 id="tenants-.applications-.routes-.runtime.php.root"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.root</code></h3>

| | |
|---|---|
| Syntax | `root: <string>` |
| Default | `none` |
| Context | `tenants[].applications[].routes[].runtime (type: php)` |
| Reload | applies on reload |

Document root; defaults to the application `root`.


<h3 id="tenants-.applications-.routes-.runtime.php.startup_timeout"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.startup_timeout</code></h3>

| | |
|---|---|
| Syntax | `startup_timeout: <duration> (e.g. 30s)` |
| Default | `30s` |
| Context | `tenants[].applications[].routes[].runtime (type: php)` |
| Reload | applies on reload |

Time the managed PHP-FPM pool gets to become ready.


<h3 id="tenants-.applications-.routes-.runtime.php.stop_timeout"><code>tenants[].applications[].routes[].runtime&lt;php&gt;.stop_timeout</code></h3>

| | |
|---|---|
| Syntax | `stop_timeout: <duration> (e.g. 30s)` |
| Default | `10s` |
| Context | `tenants[].applications[].routes[].runtime (type: php)` |
| Reload | applies on reload |

Time the managed pool gets to exit before it is killed.


<h3 id="tenants-.applications-.runtime.php.fastcgi"><code>tenants[].applications[].runtime&lt;php&gt;.fastcgi</code></h3>

| | |
|---|---|
| Syntax | `fastcgi: <string>` |
| Default | `none` |
| Context | `tenants[].applications[].runtime (type: php)` |
| Reload | applies on reload |

External pool: `unix:/path.sock` or `tcp:host:port`. Mutually exclusive with `fpm`.


<h3 id="tenants-.applications-.runtime.php.fpm"><code>tenants[].applications[].runtime&lt;php&gt;.fpm</code></h3>

| | |
|---|---|
| Syntax | `fpm: {...}` |
| Default | `none` |
| Context | `tenants[].applications[].runtime (type: php)` |
| Reload | applies on reload |

Managed PHP-FPM pool settings (workers, ini values); not used with `fastcgi`.


<h3 id="tenants-.applications-.runtime.php.fpm.binary"><code>tenants[].applications[].runtime&lt;php&gt;.fpm.binary</code></h3>

| | |
|---|---|
| Syntax | `binary: <string>` |
| Default | `none` |
| Context | `tenants[].applications[].runtime<php>.fpm` |
| Reload | applies on reload |

PHP-FPM binary; default: `php-fpm` on `PATH`, else the newest versioned one (`php-fpm8.4`, Alpine's `php-fpm84`).


<h3 id="tenants-.applications-.runtime.php.fpm.env"><code>tenants[].applications[].runtime&lt;php&gt;.fpm.env</code></h3>

| | |
|---|---|
| Syntax | `env: {<key>: <string>, ...}` |
| Default | `empty` |
| Context | `tenants[].applications[].runtime<php>.fpm` |
| Reload | applies on reload |

Environment passed to PHP (`env[...]`).


<h3 id="tenants-.applications-.runtime.php.fpm.ini"><code>tenants[].applications[].runtime&lt;php&gt;.fpm.ini</code></h3>

| | |
|---|---|
| Syntax | `ini: {<key>: <string>, ...}` |
| Default | `empty` |
| Context | `tenants[].applications[].runtime<php>.fpm` |
| Reload | applies on reload |

`php_admin_value[...]` settings, e.g. `memory_limit: 256M`.


<h3 id="tenants-.applications-.runtime.php.fpm.max_requests"><code>tenants[].applications[].runtime&lt;php&gt;.fpm.max_requests</code></h3>

| | |
|---|---|
| Syntax | `max_requests: <integer>` |
| Default | `500` |
| Context | `tenants[].applications[].runtime<php>.fpm` |
| Reload | applies on reload |

`pm.max_requests`; 0 disables recycling.


<h3 id="tenants-.applications-.runtime.php.fpm.workers"><code>tenants[].applications[].runtime&lt;php&gt;.fpm.workers</code></h3>

| | |
|---|---|
| Syntax | `workers: {...}` |
| Default | `none` |
| Context | `tenants[].applications[].runtime<php>.fpm` |
| Reload | applies on reload |

`min` = `pm.start_servers`/`pm.min_spare_servers`, `max` = `pm.max_children`.


<h3 id="tenants-.applications-.runtime.php.fpm.workers.autoscale"><code>tenants[].applications[].runtime&lt;php&gt;.fpm.workers.autoscale</code></h3>

| | |
|---|---|
| Syntax | `autoscale: off \| auto \| recommend` |
| Default | `recommend` |
| Context | `tenants[].applications[].runtime<php>.fpm.workers` |
| Reload | applies on reload |

`off`, `recommend` (default) or `auto` (ADR-0014).


<h3 id="tenants-.applications-.runtime.php.fpm.workers.max"><code>tenants[].applications[].runtime&lt;php&gt;.fpm.workers.max</code></h3>

| | |
|---|---|
| Syntax | `max: <integer>` |
| Default | `required` |
| Context | `tenants[].applications[].runtime<php>.fpm.workers` |
| Reload | applies on reload |

Upper bound when the pool is scaled.


<h3 id="tenants-.applications-.runtime.php.fpm.workers.min"><code>tenants[].applications[].runtime&lt;php&gt;.fpm.workers.min</code></h3>

| | |
|---|---|
| Syntax | `min: <integer>` |
| Default | `required` |
| Context | `tenants[].applications[].runtime<php>.fpm.workers` |
| Reload | applies on reload |

Processes started at the beginning and kept at least.


<h3 id="tenants-.applications-.runtime.php.fpm.workers.target_concurrency"><code>tenants[].applications[].runtime&lt;php&gt;.fpm.workers.target_concurrency</code></h3>

| | |
|---|---|
| Syntax | `target_concurrency: <integer>` |
| Default | `none` |
| Context | `tenants[].applications[].runtime<php>.fpm.workers` |
| Reload | applies on reload |

Concurrent requests one worker is expected to handle well (utilisation basis).


<h3 id="tenants-.applications-.runtime.php.front_controller"><code>tenants[].applications[].runtime&lt;php&gt;.front_controller</code></h3>

| | |
|---|---|
| Syntax | `front_controller: <string>` |
| Default | `none` |
| Context | `tenants[].applications[].runtime (type: php)` |
| Reload | applies on reload |

Script that handles requests for paths that do not exist, e.g. `/index.php`.


<h3 id="tenants-.applications-.runtime.php.index"><code>tenants[].applications[].runtime&lt;php&gt;.index</code></h3>

| | |
|---|---|
| Syntax | `index: [<string>, ...]` |
| Default | `["index.php","index.html"]` |
| Context | `tenants[].applications[].runtime (type: php)` |
| Reload | applies on reload |

Index files for directory requests, tried in order.


<h3 id="tenants-.applications-.runtime.php.response_timeout"><code>tenants[].applications[].runtime&lt;php&gt;.response_timeout</code></h3>

| | |
|---|---|
| Syntax | `response_timeout: <duration> (e.g. 30s)` |
| Default | `60s` |
| Context | `tenants[].applications[].runtime (type: php)` |
| Reload | applies on reload |

Time to wait for PHP-FPM's response headers.


<h3 id="tenants-.applications-.runtime.php.root"><code>tenants[].applications[].runtime&lt;php&gt;.root</code></h3>

| | |
|---|---|
| Syntax | `root: <string>` |
| Default | `none` |
| Context | `tenants[].applications[].runtime (type: php)` |
| Reload | applies on reload |

Document root; defaults to the application `root`.


<h3 id="tenants-.applications-.runtime.php.startup_timeout"><code>tenants[].applications[].runtime&lt;php&gt;.startup_timeout</code></h3>

| | |
|---|---|
| Syntax | `startup_timeout: <duration> (e.g. 30s)` |
| Default | `30s` |
| Context | `tenants[].applications[].runtime (type: php)` |
| Reload | applies on reload |

Time the managed PHP-FPM pool gets to become ready.


<h3 id="tenants-.applications-.runtime.php.stop_timeout"><code>tenants[].applications[].runtime&lt;php&gt;.stop_timeout</code></h3>

| | |
|---|---|
| Syntax | `stop_timeout: <duration> (e.g. 30s)` |
| Default | `10s` |
| Context | `tenants[].applications[].runtime (type: php)` |
| Reload | applies on reload |

Time the managed pool gets to exit before it is killed.
