Can't debug with Symfony CLI / Xdebug

2.2k Views Asked by At

I am running my server with symfony server:start command and I would like to debug it as usual with PHP remote debug provided by PhpStorm.

I've configured my Xdebug with these:

[XDebug]
xdebug.remote_enable = 1
xdebug.remote_host = localhost
xdebug.remote_port = 9001
xdebug.idekey = PHPSTORM
zend_extension=xdebug.so
xdebug.remote_autostart = 1

I have installed the debugtool for my browser and configured my server in the PHP remote debug window.

When I'm trying to debug my IDE is breaking in the router at /myuser/.symfony/php/3769648aac6303b385b2ccc41cfd442044060c7d-router.php:12 and saying it's outside the project.

I also tried path mappings with no results.

If you need more Information please let me know.

3

There are 3 best solutions below

0
On BEST ANSWER

I was running with PHP 7.4 CLI i tried to install the latest version of PHP-FPM and it's now working with the same configuration as above.

I also disabled the option the Settings/Preferences | Languages & Frameworks | PHP | Debug | Xdebug | Force break at first line when a script is outside the project as @LazyOne said, thanks to him.

0
On

Another important notice - you need to disable "Ignore external connectsion" OR PhpStorm will ignore debug connectionenter image description here

0
On

I still have this problem. Every debug request ends up with the intellij popping up with an incoming request approval for the router file /home/user/.symfony/php/xxxx-router.php, and after [ Accept ] nothing happens and the actual breakpoint is ignored.

The setting "Force break at first line when a script is outside the project" is disabled.

It's php 8.1, with xdebug 3.1.5,symfony server:start

Incoming Connection From Xdebug

Also adding the symfony server path to the skipped paths doesnt really help. Skipped Paths

The Xdebug settings:

Xdebug ini

What else can be checked?