Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 34 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,39 +63,40 @@ similar mechanism in Kubernetes or your actual platform.

### Environment variables

| Variable Name | Type | Default | Description |
|---------------------------------|---------|----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| PHP_BASE_PATH | string | /opt/flownative/php | Base path for PHP (read-only) |
| PHP_DATE_TIMEZONE | string | UTC | Default timezone ([doc](https://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone)) |
| PHP_ERROR_REPORTING | string | 2147483647 | PHP error reporting log levels ([doc](https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting)) |
| PHP_DISPLAY_ERRORS | string | off | Display PHP errors ([doc](https://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors)) |
| PHP_ERROR_LOG | string | /dev/stderr | Path leading to the file where PHP errors should be logged |
| PHP_FPM_ERROR_LOG_PATH | string | /opt/flownative/log/php-fpm-error.log | Path leading to the file where PHP-FPM errors should be logged |
| PHP_FPM_ACCESS_LOG_PATH | string | /opt/flownative/log/php-fpm-access.log | Path leading to the file where PHP-FPM access should be logged |
| PHP_MEMORY_LIMIT | string | 750M | PHP memory limit ([doc](https://www.php.net/manual/en/ini.core.php#ini.memory-limit)) |
| PHP_OPCACHE_PRELOAD | string | | Path and filename of a preload script ([doc](https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.preload)) |
| PHP_XDEBUG_ENABLE | boolean | false | Enable or disable the Xdebug extension |
| PHP_XDEBUG_MODE | string | develop | Controls which Xdebug features are enabled, for example "develop" or "debug". See Xdebug manual for details |
| PHP_XDEBUG_CONFIG | string | | Values assigned to this variable are propagated as XDEBUG_CONFIG. See Xdebug manual for details |
| PHP_XDEBUG_DISCOVER_CLIENT_HOST | boolean | false | If enabled, Xdebug will first try to connect to the client that made the HTTP request. See Xdebug manual for details |
| PHP_XDEBUG_CLIENT_HOST | string | | Configures the IP address or hostname where Xdebug will attempt to connect to when initiating a debugging connection. See Xdebug manual for details |
| PHP_XDEBUG_MAX_NESTING_LEVEL | integer | 512 | Controls the protection mechanism for infinite recursion protection. See Xdebug manual for details |
| PHP_IGBINARY_ENABLE | boolean | false | Enable or disable the igbinary extension |
| PHP_EXCIMER_ENABLE | boolean | false | Enable or disable the Excimer extension |
| PHP_FPM_USER | string | 1000 | User id for running PHP (read-only) |
| PHP_FPM_GROUP | string | 1000 | Group id for running PHP (read-only) |
| PHP_FPM_PORT | string | 9000 | Port the PHP-FPM process listens to |
| PHP_FPM_MAX_CHILDREN | string | 20 | Maximum number of children to run |
| PHP_FPM_MAX_REQUESTS | string | 500 | Number of requests after which a worker is recycled to mitigate memory leaks; set to 0 to disable |
| PHP_FPM_REQUEST_SLOWLOG_TIMEOUT | string | 0 | Log requests (and count them on the FPM status page) that take longer than this, e.g. "5s"; set to 0 to disable |
| PHP_FPM_SLOWLOG_PATH | string | /opt/flownative/log/php-fpm-slow.log | Destination file for slowlog backtraces, used when PHP_FPM_REQUEST_SLOWLOG_TIMEOUT is enabled |
| PHP_FPM_PM_MODE | string | ondemand | Process manager mode for PHP-FPM; "static", "ondemand" or "dynamic" |
| PHP_SPX_ENABLE | boolean | false | Enable or disable the SPX extension |
| PHP_SPX_KEY | string | dev | The secret key used for authentication |
| PHP_SPX_IP_WHITELIST | string | | The IP address white list used for authentication as a comma separated list of IP addresses† |
| PHP_SPX_IP_VAR | string | REMOTE_ADDR | The $_SERVER key holding the client IP address used for authentication |
| PHP_SPX_TRUSTED_PROXIES | string | 127.0.0.1 | The trusted proxy list as a comma separated list of IP addresses†, ingored when `PHP_SPX_IP_VAR`is `REMOTE_ADDR` |
| | | | |
| Variable Name | Type | Default | Description |
|-----------------------------------|---------|----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| PHP_BASE_PATH | string | /opt/flownative/php | Base path for PHP (read-only) |
| PHP_DATE_TIMEZONE | string | UTC | Default timezone ([doc](https://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone)) |
| PHP_ERROR_REPORTING | string | 2147483647 | PHP error reporting log levels ([doc](https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting)) |
| PHP_DISPLAY_ERRORS | string | off | Display PHP errors ([doc](https://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors)) |
| PHP_ERROR_LOG | string | /dev/stderr | Path leading to the file where PHP errors should be logged |
| PHP_FPM_ERROR_LOG_PATH | string | /opt/flownative/log/php-fpm-error.log | Path leading to the file where PHP-FPM errors should be logged |
| PHP_FPM_ACCESS_LOG_PATH | string | /opt/flownative/log/php-fpm-access.log | Path leading to the file where PHP-FPM access should be logged |
| PHP_MEMORY_LIMIT | string | 750M | PHP memory limit ([doc](https://www.php.net/manual/en/ini.core.php#ini.memory-limit)) |
| PHP_OPCACHE_PRELOAD | string | | Path and filename of a preload script ([doc](https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.preload)) |
| PHP_XDEBUG_ENABLE | boolean | false | Enable or disable the Xdebug extension |
| PHP_XDEBUG_MODE | string | develop | Controls which Xdebug features are enabled, for example "develop" or "debug". See Xdebug manual for details |
| PHP_XDEBUG_CONFIG | string | | Values assigned to this variable are propagated as XDEBUG_CONFIG. See Xdebug manual for details |
| PHP_XDEBUG_DISCOVER_CLIENT_HOST | boolean | false | If enabled, Xdebug will first try to connect to the client that made the HTTP request. See Xdebug manual for details |
| PHP_XDEBUG_CLIENT_HOST | string | | Configures the IP address or hostname where Xdebug will attempt to connect to when initiating a debugging connection. See Xdebug manual for details |
| PHP_XDEBUG_MAX_NESTING_LEVEL | integer | 512 | Controls the protection mechanism for infinite recursion protection. See Xdebug manual for details |
| PHP_IGBINARY_ENABLE | boolean | false | Enable or disable the igbinary extension |
| PHP_EXCIMER_ENABLE | boolean | false | Enable or disable the Excimer extension |
| PHP_FPM_USER | string | 1000 | User id for running PHP (read-only) |
| PHP_FPM_GROUP | string | 1000 | Group id for running PHP (read-only) |
| PHP_FPM_PORT | string | 9000 | Port the PHP-FPM process listens to |
| PHP_FPM_MAX_CHILDREN | string | 20 | Maximum number of children to run |
| PHP_FPM_MAX_REQUESTS | string | 500 | Number of requests after which a worker is recycled to mitigate memory leaks; set to 0 to disable |
| PHP_FPM_REQUEST_TERMINATE_TIMEOUT | string | 0 | Wall-clock time after which a request is forcibly terminated, e.g. "300s"; for requests stuck on I/O that `max_execution_time` misses; set to 0 to disable |
| PHP_FPM_REQUEST_SLOWLOG_TIMEOUT | string | 0 | Log requests (and count them on the FPM status page) that take longer than this, e.g. "5s"; set to 0 to disable |
| PHP_FPM_SLOWLOG_PATH | string | /opt/flownative/log/php-fpm-slow.log | Destination file for slowlog backtraces, used when PHP_FPM_REQUEST_SLOWLOG_TIMEOUT is enabled |
| PHP_FPM_PM_MODE | string | ondemand | Process manager mode for PHP-FPM; "static", "ondemand" or "dynamic" |
| PHP_SPX_ENABLE | boolean | false | Enable or disable the SPX extension |
| PHP_SPX_KEY | string | dev | The secret key used for authentication |
| PHP_SPX_IP_WHITELIST | string | | The IP address white list used for authentication as a comma separated list of IP addresses† |
| PHP_SPX_IP_VAR | string | REMOTE_ADDR | The $_SERVER key holding the client IP address used for authentication |
| PHP_SPX_TRUSTED_PROXIES | string | 127.0.0.1 | The trusted proxy list as a comma separated list of IP addresses†, ingored when `PHP_SPX_IP_VAR`is `REMOTE_ADDR` |
| | | | |

† – `*` (match all) and subnet masks (e.g. `192.168.1.0/24`) are supported.

Expand Down
1 change: 1 addition & 0 deletions root-files/opt/flownative/lib/php-fpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export PHP_FPM_PORT="${PHP_FPM_PORT:-9000}"
export PHP_FPM_PM_MODE="${PHP_FPM_PM_MODE:-ondemand}"
export PHP_FPM_MAX_CHILDREN="${PHP_FPM_MAX_CHILDREN:-20}"
export PHP_FPM_MAX_REQUESTS="${PHP_FPM_MAX_REQUESTS:-500}"
export PHP_FPM_REQUEST_TERMINATE_TIMEOUT="${PHP_FPM_REQUEST_TERMINATE_TIMEOUT:-0}"
export PHP_FPM_REQUEST_SLOWLOG_TIMEOUT="${PHP_FPM_REQUEST_SLOWLOG_TIMEOUT:-0}"
export PHP_FPM_ERROR_LOG_PATH="${PHP_FPM_ERROR_LOG_PATH:-/opt/flownative/log/php-fpm-error.log}"
export PHP_FPM_ACCESS_LOG_PATH="${PHP_FPM_ACCESS_LOG_PATH:-/opt/flownative/log/php-fpm-access.log}"
Expand Down
2 changes: 2 additions & 0 deletions root-files/opt/flownative/php/etc/php-fpm.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ pm = ${PHP_FPM_PM_MODE}
pm.max_children = ${PHP_FPM_MAX_CHILDREN}
pm.max_requests = ${PHP_FPM_MAX_REQUESTS}

request_terminate_timeout = ${PHP_FPM_REQUEST_TERMINATE_TIMEOUT}

slowlog = ${PHP_FPM_SLOWLOG_PATH}
request_slowlog_timeout = ${PHP_FPM_REQUEST_SLOWLOG_TIMEOUT}

Expand Down