WordPress.org

Make WordPress Core

Opened 6 weeks ago

Last modified 5 weeks ago

#49953 new defect (bug)

Xdebug not working out of the box

Reported by: Jules Colle Owned by:
Milestone: 5.5 Priority: normal
Severity: normal Version: 5.3
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

This issue is regarding the wordpress-develop repo on github

I expected Xdebug to work out of the box after setting LOCAL_PHP_XDEBUG=true in the .env file, but that wasn't enough.

It looks like I had to add a couple of lines to tools/local-env/php-config.ini as well:

xdebug.remote_enable=1
xdebug.remote_connect_back=1

In my opinion, these lines should be added to php-config.ini by default.

---

Additionally, I have a suggestion to also add some information on how to use Xdebug for WP core development with VS code, as it turns out you also need some custom configuration in the .vscode/launch.json file. I've written an article about this: https://bdwm.be/wordpress-core-development-with-xdebug-and-vs-code/

Feel free to quote the article or include parts of it in the WP developer documentation.

Attachments (2)

49953.diff (330 bytes) - added by Jules Colle 5 weeks ago.
Adds 2 lines of configuration, necessary to make Xdebug work in the docker container.
49953-2.diff (302 bytes) - added by Jules Colle 5 weeks ago.
re-added newline at end of file

Download all attachments as: .zip

Change History (5)

This ticket was mentioned in Slack in #core by jules-colle. View the logs.


6 weeks ago

@Jules Colle
5 weeks ago

Adds 2 lines of configuration, necessary to make Xdebug work in the docker container.

#2 @Jules Colle
5 weeks ago

  • Keywords has-patch added; needs-patch removed

@Jules Colle
5 weeks ago

re-added newline at end of file

#3 @johnbillion
5 weeks ago

  • Milestone changed from Awaiting Review to 5.5
  • Version changed from trunk to 5.3

Thanks for the patch and the link to the blog post @jules-colle .

Autostarting the remote debugging and automatically connecting back to the initiating client definitely makes sense for a local development environment.

Note: See TracTickets for help on using tickets.