wodby / php

Generic PHP docker container images
MIT License
152 stars 103 forks source link

Enabling xdebug from environment variable #176

Closed Chi-teck closed 6 months ago

Chi-teck commented 1 year ago

I would like to enable/disable xdebug extension from environment variable which is configured in .env file. I put the following statement to the docker-compose.yml file but it did not work out by some reason.

PHP_XDEBUG: ${PHP_XDEBUG}

I guess this condition is evaluated to true when the variable holds an empty string. https://github.com/wodby/php/blob/c5b31a0ceeac7298a5cbefa54800d759ebc986cb/8/templates/docker-php-ext-xdebug.ini.tmpl#L1

I am not familiar with go template syntax. Can it check more explicitly for emptiness of PHP_XDEBUG variable?

weitzman commented 6 months ago

Sounds like https://github.com/wodby/php/issues/58#issuecomment-610737418 again. Its bitten many people, unfortunately.

csandanov commented 6 months ago

We probably need to get rid of this env var completely, the default mode off should have close to 0 performance impact and in any case we still have PHP_EXTENSIONS_DISABLE

weitzman commented 6 months ago

That makes sense. Thanks.