Skip to content

bin/xdebug enable shows "Invalid mode: enable" and PhpStorm does not receive debug connections #1348

Closed
@roneclay

Description

@roneclay

Description

I followed the documentation to enable Xdebug and connect it with PhpStorm, but encountered the following issues:

  1. The command bin/xdebug enable fails with the following error:
    Invalid mode: enable

Valid modes are:

off

develop

coverage

debug

gcstats

profile

trace

  1. I then tried bin/xdebug debug, which worked for enabling debug mode. However, PhpStorm still doesn't receive any Xdebug connections, and breakpoints are not triggered.

This suggests:

  • Either the documentation is outdated (enable is not a valid mode),
  • Or something is misconfigured between the container and PhpStorm.

Steps To Reproduce

  1. Clone and set up the project using markshust/docker-magento
  2. Run bin/xdebug enable
    → Observe the "Invalid mode" error
  3. Run bin/xdebug debug instead
  4. Install Chrome Xdebug Helper and set IDE Key to PHPSTORM
  5. Open PhpStorm and enable "Listen for PHP Debug Connections"
  6. Try to access the Magento frontend or a PHP file and hit a breakpoint

Expected Result

  • bin/xdebug enable should work as documented
  • PhpStorm should receive incoming Xdebug connections
  • Breakpoints should be triggered correctly

Actual Result

  • bin/xdebug enable fails:
    Invalid mode: enable

  • PhpStorm does not receive any Xdebug connection

  • Breakpoints are not hit

Environment

  • OS: macOS 15.1.1 (Build 24B91)
  • Docker version: 27.4.0, build bde2b89
  • PhpStorm version: 2025.1.1
  • Magento version: 2.4.8
  • Xdebug version in container:
php -v | grep Xdebug
  with Xdebug v3.4.1, Copyright (c) 2002–2025, by Derick Rethans

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions