Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.

Add XDebug 3 support - #19

Draft
pierlon wants to merge 1 commit into
GoogleChromeLabs:masterfrom
pierlon:support/xdebug-3
Draft

Add XDebug 3 support#19
pierlon wants to merge 1 commit into
GoogleChromeLabs:masterfrom
pierlon:support/xdebug-3

Conversation

@pierlon

@pierlon pierlon commented Feb 8, 2021

Copy link
Copy Markdown
Contributor

With XDebug 3, Lando now configures XDebug through the XDEBUG_MODE and XDEBUG_CONFIG environment vars. The XDEBUG_MODE environment var configures the xdebug.mode XDebug config var, and XDEBUG_CONFIG configures any additional XDebug config vars one may want to modify.

When xdebug=true in Lando, by default xdebug.mode would be set to debug, and XDEBUG_CONFIG would set some pre-defined config vars to enable remote debugging and logging.

Comment thread php.ini
Comment on lines -1 to -3
xdebug.remote_enable = 1
xdebug.remote_autostart = 0
xdebug.remote_connect_back = 0

@pierlon pierlon Feb 8, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These are all now redundant since Lando provides these equivalent config vars by default via the XDEBUG_CONFIG environment var (client_host, discover_client_host, remote_enable and remote_enable).

Comment thread php.ini
xdebug.remote_enable = 1
xdebug.remote_autostart = 0
xdebug.remote_connect_back = 0
xdebug.remote_port=9000

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The default remote port for XDebug 3 is now 9003.

Comment thread php.ini
xdebug.remote_connect_back = 0
xdebug.remote_port=9000
html_errors = 1
xdebug.start_with_request = yes

@pierlon pierlon Feb 8, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

With this being set to true, XDebug profiling is started with every request. The other option would be to enable profiling on trigger, but that requires either setting an environment variable (XDEBUG_TRIGGER), $_GET or $_POST variable, or via cookie (see the docs).

@pierlon
pierlon marked this pull request as draft February 16, 2021 09:12
@pierlon

pierlon commented Feb 16, 2021

Copy link
Copy Markdown
Contributor Author

Tested this against Lando v3.0.25 and noticed some irregularities so I'm marking this as a draft for now until I find out what's wrong.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant