Closed Bug 1606762 Opened 5 years ago Closed 4 years ago

Set up xdebug

Categories

(Conduit :: Phabricator, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mhentges, Assigned: mhentges)

References

Details

(Keywords: conduit-triaged)

Attachments

(2 files, 2 obsolete files)

We should be able to use a debugger while working on Phabricator.

Steps:

  1. Document that your IDE/debugger should be configured to listen on 9000, the XDebug default port
  2. (dependent on 1606383) separate production and development Phabricator image build steps
  3. In the development Phabricator image, install PHP XDebug
  4. When docker-compose spools up, our containers run in a network like 172.[same number for all containers].0.[unique number per container. Importantly, 172.[number].0.1 refers to the host. In entrypoint.sh, calculate the host's ip in this virtual network, and add the following options to PHP for dev_start:
  • -d xdebug.remote_host = 172.[number].0.1
  • -d xdebug.remote_enable = 1
  1. Document installing the XDebug helper for Firefox and how to use it
  2. Test ^, I might've forgotten an XDebug feature

This is especially valuable to me for two reasons:

  1. I'm getting up-to-speed with Phabricator, and having the ability to step into data structures ergonomically is enormously helpful in spooling up
  2. Being able to step through logic to find out why a bug is happening (so you can, y'know, de-bug your software πŸ˜›) can make the process much faster
Type: defect → enhancement

Ugh, manually specifying path mappings has to be done too, this should be documented as part of the patch as well

Depends on: 1605890

Targets development phabricator image which includes xdebug support

Splits dockerfile into multi-stage-build so that we have a production and development target.
Installs xdebug in the development target.

Documents how to set up your IDE for xdebug

Depends on D57720

Splits dockerfile into multi-stage-build so that we have a production and development target.
Installs xdebug in the development target.

Documents how to set up your IDE for xdebug

Depends on D57720

Attachment #9118603 - Attachment is obsolete: true
Attachment #9118603 - Attachment is obsolete: false

Don't forget this patch

Assignee: nobody → mhentges
Status: NEW → ASSIGNED
Attachment #9118603 - Attachment is obsolete: true

Three things:

  1. Initial xdebug support only worked for debugging webserver pages, but not the daemon. I added support for that, but:
  2. The phabricator daemon runs a lot of processes. These would fill up all of PHPStorm's "max. simultaneous connections", making page loads hang. This is worked around by bumping the max connections (TODO: document and update my PR!) or by not running a debugger (so, non-debugger users won't be affected)
  3. I still need to test attaching a debugger and catching a "moz-phab submit" operation, which will be awesome when it works
Attachment #9118602 - Attachment is obsolete: true

Splits dockerfile into multi-stage-build so that we have a production and development target.
Installs xdebug in the development target.

Documents how to set up your IDE for xdebug

This is ready for review now πŸ‘

Keywords: conduit-triaged
Priority: -- → P2
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: