Skip to content
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions builders/php.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Xdebug log created unconditionally even when xdebug disabled

Medium Severity

The touch /tmp/xdebug.log && chmod 666 /tmp/xdebug.log build step runs unconditionally for every PHP container, but the xdebug enable step on line 256 is gated behind if (options.xdebug). The log file pre-creation belongs inside that same conditional so it only runs when xdebug is actually enabled. Without this guard, every PHP build unnecessarily creates a world-writable file.

Fix in Cursor Fix in Web


// Add build step to enable xdebug
if (options.xdebug) {
addBuildStep(['docker-php-ext-enable xdebug'], options._app, options.name, 'build_as_root_internal');
Expand Down
Loading