Search code examples
eclipsephpeclipse

Unable to Debug Local CLI Project


I've been working on a CLI project and I'm in desperate need of getting the debugger working. I'm using Eclipse for PHP Developers 2021-09 (4.21.0) and recently updated from 2021-03. I am running PHP 8.0.7. I am able to create a PHP CLI Application run configuration.

Run Config

But when I go to Project -> Properties under the Run/Debug Settings section there are no launch configurations available and when I click New there is no option to create a new launch configuration for a CLI program.

Project Run/Debug Settings

My project runs fine and I'm able to echo out to the console but I absolutely cannot get this debugger to stop at any debug points. I've been unable to find any reference to this problem anywhere else. Please help!


Solution

  • I finally got this working! To get your debugger working for CLI programs, make the following environment changes:

    php.ini, this line : xdebug.mode = debug

    Eclipse Preferences/PHP/Servers Default PHP Web Server (Workspace Default) >>> http://localhost

    Eclipse Preferences/PHP/Debug PHP Server >>> Default PHP Web Server

    Eclipse Preferences/PHP/Debug/Debuggers/ Xdebug / Configure / Debug Port 9003

    Reference: https://www.eclipse.org/forums/index.php?t=msg&th=1107981&goto=1841480&#msg_1841480