diff --git a/CHANGELOG.md b/CHANGELOG.md index eb52f33..ceb3d2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +* Fixed xdebug log file ownership issue when `build_as_root` or `run_as_root` creates `/tmp/xdebug.log` as root [#242](https://github.com/lando/php/pull/242) + ## v1.11.2 - [February 25, 2026](https://github.com/lando/php/releases/tag/v1.11.2) * Fixed composer install crash caused by legacy prestissimo removal running as wrong user diff --git a/builders/php.js b/builders/php.js index 8a63dfc..5745f1b 100644 --- a/builders/php.js +++ b/builders/php.js @@ -248,6 +248,10 @@ module.exports = { options.composer_version = options.composer_version.toString(); } + // Pre-create xdebug log with world-writable permissions so root-owned builds + // don't block www-data from writing to it later + addBuildStep(['touch /tmp/xdebug.log && chmod 666 /tmp/xdebug.log'], options._app, options.name, 'build_as_root_internal'); + // Add build step to enable xdebug if (options.xdebug) { addBuildStep(['docker-php-ext-enable xdebug'], options._app, options.name, 'build_as_root_internal');