Skip to content

Commit 24a73e7

Browse files
authored
Merge pull request #23 from flownative/xdebug-configuration
Provide more Xdebug configuration options
2 parents 56cd173 + db84a72 commit 24a73e7

File tree

4 files changed

+54
-19
lines changed

4 files changed

+54
-19
lines changed

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 - 2023 Robert Lemke, Flownative GmbH
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

README.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,28 @@ similar mechanism in Kubernetes or your actual platform.
6565

6666
### Environment variables
6767

68-
| Variable Name | Type | Default | Description |
69-
| ----------------------- | ------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
70-
| PHP_BASE_PATH | string | /opt/flownative/php | Base path for PHP (read-only) |
71-
| PHP_DATE_TIMEZONE | string | UTC | Default timezone ([doc](https://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone)) |
72-
| PHP_ERROR_REPORTING | string | 2147483647 | PHP error reporting log levels ([doc](https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting)) |
73-
| PHP_DISPLAY_ERRORS | string | off | Display PHP errors ([doc](https://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors)) |
74-
| PHP_ERROR_LOG | string | /dev/stderr | Path leading to the file where PHP errors should be logged |
75-
| 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 |
76-
| 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 |
77-
| PHP_MEMORY_LIMIT | string | 750M | PHP memory limit ([doc](https://www.php.net/manual/en/ini.core.php#ini.memory-limit)) |
78-
| PHP_OPCACHE_PRELOAD | string | | Path and filename of a preload script ([doc](https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.preload)) |
79-
| PHP_XDEBUG_ENABLE | boolean | false | Enable or disable the Xdebug extension |
80-
| PHP_IGBINARY_ENABLE | boolean | false | Enable or disable the igbinary extension |
81-
| PHP_FPM_USER | string | 1000 | User id for running PHP (read-only) |
82-
| PHP_FPM_GROUP | string | 1000 | Group id for running PHP (read-only) |
83-
| PHP_FPM_PORT | string | 9000 | Port the PHP-FPM process listens to |
84-
| PHP_FPM_MAX_CHILDREN | string | 20 | Maximum number of children to run |
85-
| PHP_FPM_PM_MODE | string | ondemand | Process manager mode for PHP-FPM; "static", "ondemand" or "dynamic" |
86-
| | | | |
68+
| Variable Name | Type | Default | Description |
69+
|---------------------------------|---------|----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
70+
| PHP_BASE_PATH | string | /opt/flownative/php | Base path for PHP (read-only) |
71+
| PHP_DATE_TIMEZONE | string | UTC | Default timezone ([doc](https://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone)) |
72+
| PHP_ERROR_REPORTING | string | 2147483647 | PHP error reporting log levels ([doc](https://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting)) |
73+
| PHP_DISPLAY_ERRORS | string | off | Display PHP errors ([doc](https://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors)) |
74+
| PHP_ERROR_LOG | string | /dev/stderr | Path leading to the file where PHP errors should be logged |
75+
| 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 |
76+
| 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 |
77+
| PHP_MEMORY_LIMIT | string | 750M | PHP memory limit ([doc](https://www.php.net/manual/en/ini.core.php#ini.memory-limit)) |
78+
| PHP_OPCACHE_PRELOAD | string | | Path and filename of a preload script ([doc](https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.preload)) |
79+
| PHP_XDEBUG_ENABLE | boolean | false | Enable or disable the Xdebug extension |
80+
| 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 |
81+
| PHP_XDEBUG_CLIENT_HOST | string | host.xdebug.beach | Configures the IP address or hostname where Xdebug will attempt to connect to when initiating a debugging connection. See Xdebug manual for details |
82+
| PHP_XDEBUG_MAX_NESTING_LEVEL | integer | 512 | Controls the protection mechanism for infinite recursion protection. See Xdebug manual for details |
83+
| PHP_IGBINARY_ENABLE | boolean | false | Enable or disable the igbinary extension |
84+
| PHP_FPM_USER | string | 1000 | User id for running PHP (read-only) |
85+
| PHP_FPM_GROUP | string | 1000 | Group id for running PHP (read-only) |
86+
| PHP_FPM_PORT | string | 9000 | Port the PHP-FPM process listens to |
87+
| PHP_FPM_MAX_CHILDREN | string | 20 | Maximum number of children to run |
88+
| PHP_FPM_PM_MODE | string | ondemand | Process manager mode for PHP-FPM; "static", "ondemand" or "dynamic" |
89+
| | | | |
8790

8891
## Security aspects
8992

root-files/opt/flownative/lib/php-fpm.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ export PHP_ERROR_LOG="${PHP_ERROR_LOG:-/dev/stderr}"
3434
export PHP_OPCACHE_PRELOAD="${PHP_OPCACHE_PRELOAD:-}"
3535
3636
export PHP_XDEBUG_ENABLE="${PHP_XDEBUG_ENABLE:-false}"
37+
export PHP_XDEBUG_DISCOVER_CLIENT_HOST="${PHP_XDEBUG_DISCOVER_CLIENT_HOST:-false}"
38+
export PHP_XDEBUG_CLIENT_HOST="${PHP_XDEBUG_CLIENT_HOST:-host.xdebug.beach}"
39+
export PHP_XDEBUG_MAX_NESTING_LEVEL="${PHP_XDEBUG_MAX_NESTING_LEVEL:-512}"
40+
3741
export PHP_IGBINARY_ENABLE="${PHP_IGBINARY_ENABLE:-false}"
3842
3943
export PHP_FPM_USER="1000"

root-files/opt/flownative/php/etc/php.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,10 @@ opcache.save_comments=1
265265
; requests out of the box, until the server is shut down.
266266
opcache.preload = ${PHP_OPCACHE_PRELOAD}
267267

268+
[xdebug]
269+
; The extension is loaded via /opt/flownative/php/etc/conf.d/php-ext-xdebug.ini, if PHP_XDEBUG_ENABLE is true
270+
268271
xdebug_enable=${PHP_XDEBUG_ENABLE}
272+
xdebug.discover_client_host=${PHP_XDEBUG_DISCOVER_CLIENT_HOST}
273+
xdebug.client_host=${PHP_XDEBUG_CLIENT_HOST}
274+
xdebug.max_nesting_level=${PHP_XDEBUG_MAX_NESTING_LEVEL}

0 commit comments

Comments
 (0)