2

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.

6
  • 1) Where your project is located on your computer (the path to the project root)? I do not think it will be in /myuser/.symfony/php/ folder .. so the "outside of the project" message will be correct here. 2) That path, it looks like a PHP temp folder or alike and that 3769648aac6303b385b2ccc41cfd442044060c7d-router.php file is auto-generated (Symfony optimisation/compilation). Commented Oct 18, 2020 at 14:06
  • 3) You can tell PhpStorm to ignore files that are outside of the project -- disable Settings/Preferences | Languages & Frameworks | PHP | Debug | Xdebug | Force break at first line when a script is outside the project option for that. Commented Oct 18, 2020 at 14:08
  • P.S. Your desrciption is not super clear for me right now: on one hand I see that you are running your web server with symfony server:start command (that suggests that it's a local execution (the same OS/host)). Then you are mentioning "php remote debug" few times ... that suggests otherwise (that it's a remote debug .. and perhaps path mappings is the issue here). You better clarify your setup as much as possible, with screenshots (they help a lot) Commented Oct 18, 2020 at 14:11
  • In either case, check these links: 1) jetbrains.com/phpstorm/documentation/debugging 2) jetbrains.com/help/phpstorm/… 3) jetbrains.com/help/phpstorm/troubleshooting-php-debugging.html Commented Oct 18, 2020 at 14:12
  • @LazyOne 1) My project is in /Documents/dev/myproject and that's breaking in my Symfony CLI installed in my computer. Commented Oct 18, 2020 at 17:21

3 Answers 3

2

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

0

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?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.