Reputation: 89
I hope somebody here can help me with my issue:
I recently gotten into my first PHP project and need to set up debugging. I'm aware many people had the same problem before me but I struggle to find a solution.
I need to set up PhpStorm with Xdebug and with all settings made its still not working and when I start my debug session i get stuck at this with no further information:
This is my project setup:
Docker Webapp with Xdebug: 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp
PhpStorm PHP Debug Settings:
Xdebug settings from phpinfo()
:
Listening to debug connections in PhpStorm is on, starting a debug session create a session via GET: https://localhost/?XDEBUG_SESSION_START=16957
but all my breakpoints are ignored.
Trying to get more information I ran netstat
:
Can anyone tell me what I am missing here?
Thank you very much in advance!
Upvotes: 3
Views: 748
Reputation: 928
i used this setting and it worked :)
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
xdebug.default_enable=1
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.profiler_enable=0
xdebug.profiler_output_dir="/var/www/html"
xdebug.var_display_max_depth=20
xdebug.remote_host=host.docker.internal
xdebug.remote_enable=1
xdebug.remote_connect_back=0
with launch.json in vscode
"name": "Listen 9000",
"type": "php",
"request": "launch",
"log": true,
"externalConsole": false,
"pathMappings": {
"/var/www/html": "/Users/folder/project/src"
},
"port": 9000,
With docker-compose.yml:
Upvotes: 0
Reputation: 3043
xdebug.remote_connect_back
, it brings more harm than profit, especially with Docker.xdebug.remote_host
is not supposed to be localhost
when you are using Docker, this way, the container is trying to send the debug data to itself instead of the host machine. It seems that you are using macOS and Docker for Mac, the correct hostname would be host.docker.internal
in such a case.A blog post showing Docker in PhpStorm basics: https://blog.jetbrains.com/phpstorm/2018/08/quickstart-with-docker-in-phpstorm/
Upvotes: 6