6219

How to connect PhpStorm with Xdebug

<h3>Question</h3>

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!


<h3>Answer1:</h3>
<ol><li>Don't use run/debug configurations for web debugging, it's counter-productive. You can initiate debugging connections from the browser directly using zero-configuration debugging.</li> <li>Disable xdebug.remote_connect_back, it brings more harm than profit, especially with Docker.</li> <li>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.</li> <li>If after you initiate a debugging session from the browser PhpStorm still cannot catch a connection, we'll need to take a look at the Xdebug log as @LazyOne suggested.</li> </ol>

A blog post showing Docker in PhpStorm basics: https://blog.jetbrains.com/phpstorm/2018/08/quickstart-with-docker-in-phpstorm/

来源:https://stackoverflow.com/questions/62203607/how-to-connect-phpstorm-with-xdebug

Recommend

  • How to connect PhpStorm with Xdebug
  • tensorflow py_func is handy but makes my training step very slow.
  • What does coercing the “direction” argument input in roc function (package pROC in R) do exactly?
  • MapWithOverlaysActivity - Could not determine $(TargetFrameworkVersion)
  • Issue while trying to pass json of translation key-value from laravel blade to vue.js
  • Load JavaScript and CSS files in folders in AngularJS
  • The Current .Net SDK does not support targeting .Net Core 2.2 Target .Net Core 2.1 or Lower [duplica
  • Cross Domain Image upload Angular+laravel
  • Sparql: how to GROUP BY More Than One Column
  • Bash: expand parameters from variable. How?
  • Crystal Report rendered differently on server and development machine
  • spring security client_credentials grant_type - support for refresh token
  • Kotlin Higher Order Function Composition
  • Amazon API generating a request signature in C# .NET
  • How to put text in front of auto increment field in mysql (like : TTT00001)? [duplicate]
  • How to deploy parent project packaging war in maven
  • Details on WSDL bindings
  • RobotFramework - AutoItLibrary: Importing test library “AutoItLibrary” failed
  • Java Hibernate Check MySQL Replication is in sync
  • svnserve and SASL problem
  • how to synchronize web site content while loading page
  • Is there a way to run c# forms application without showing a gui window (like a console application)
  • Send HTML Mail with Unicode
  • Using django-multiupload within a ModelForm
  • Generate a runnable jar and include libraries in it with Maven
  • Extract table from Powerpoint
  • Unity Resources.load() won't work with external dll
  • Can I read another applications memory?
  • Why isn't stemDocument stemming?
  • How to handle div that is created dynamically in a table
  • customize soft keyboard key preview
  • Using Service Component Runtime
  • How to use FirstOrDefault inside Include
  • PHP Permalinks.. how to change?
  • media foundation H264 decoder not working properly
  • Running R's aov() mixed effects model from Python using rpy2
  • Access to a Matlab gui from the web