xdebug not communicating with phpstorm
I am trying to use Xdebug with PhpStorm on a Windows 10 machine. There doesn't appear to be any communication between Xdebug and phpstorm, i.e. even though I set a breakpoint, the page loads as normal. I have tried reloading the page, but still nothing. I am not seeing a popup in phpstorm to accept the incoming communication.
I have a very simple configuration. Everything is local and I am using the built in web server. I have the following in my php.ini file:
zend_extension = C:\xampp\php\ext\php_xdebug-2.7.2-7.3-vc15-x86_64.dll
xdebug.remote_enable=1
xdebug.remote_autostart = 1
xdebug.remote_port="9000"
xdebug.remote_host=localhost
I have the debug port set to 9000 in the phpstorm settings.
I have the Xdebug extension enabled in Chrome.
I have looked at the Xdebug log, but am not seeing any obvious errors.
On the validate debugger configuration screen, I am getting "Server Name is empty" as in the following screenshot:

At this point, I have run out of ideas. Any suggestions?
Thanks,
David.
请先登录再写评论。
Just a few updates since posting the original message.
I have tried changing the port to 9001. Makes no difference
I have updated Xdebug. Makes no difference
I have tried changing the IDEkey. Makes no difference.
I have tried banging my head against the wall. Makes my head hurt.
Any suggestions would be most welcome.
Thanks,
David.
Hi there,
1) Please show whole Xdebug section from the phpinfo() output (captured in the same way as you are trying to debug)
2) Enable, collect and share Xdebug log for such unsuccessful debug session. It will show where Xdebug is trying to connect to (if at all) and what the response is.
P.S. Based on your screenshot and php.ini content (Xdebug settings) you seem to have XAMPP .. but the URL used to validate Xdebug uses PhpStorm's own built-in simple web server and not XAMPP... 🤔
Hi Andriy,
Here is the Xdebug from phpInfo():
I don't see a way of uploading an attachment, so here are a couple of screenshots of the log:
I hope you can zoom/enlarge the screenshots. If not, let me know and I will copy and paste.
Originally, I did load the Apache Web Server and PHP using XAMPP. However, I decided to use the built in web server instead. I teach a web development class and I am trying to keep things as simple as possible for my students. They are doing everything locally, which reduces the complexity for learning purposes. They are able to do what they need with the built in web server and so I wanted my configuration to mirror theirs. Everything else is working just fine. The debugging is my only problem.
Appreciate your help.
David
Thanks.
You may upload Xdebug log somewhere (e.g. pastebin, gist .. or just Google Drive or alike) and share the link.
1) What's your IDE version exactly?
2) Xdebug logs shows that it connects to PhpStorm just fine. The rest -- I cannot say much from the partial screenshots -- need to see the whole file to have some better understanding.
3) Please also show how the file with breakpoints looks in the IDE (what line number that is etc)
4) Does PhpStorm shows any debug related messages/windows?
5) Try deleting all entries at "Settings | Languages & Frameworks | PHP | Servers" -- IDE will help creating a new one next time.
6) Also show your "PHP | Debug" settings.
Right now it could be the empty web server name (which built-in web server may not set up correctly -- https://youtrack.jetbrains.com/issue/WI-54542)...
Ideally it would be great if you can make some screencast (e.g. https://recordit.co/ or whatever else) with the settings + your debug attempt (as it's so much easier to try and debug personally/with own eyes than guessing different aspects and what else might be missing/incorrect).
Hi there,
1) IDE version is PhpStorm 2020.2.3
Build #PS-202.7660.42, built on October 16, 2020
2) Log file is at https://drive.google.com/file/d/1goZQsOoVzJdGsAJdTf_yT5UtEgggi3Fd/view?usp=sharing
3) I currently have "Break at first line" set and a breakpoint as shown on this screenshot:
4) The only message I have seen in phpstorm is Connected to localhost:50265. I have no idea where that port came from. Nothing that I specified.
5) I have removed the server. The only one there was localhost. It has not been re-created even though I tried running the page again:
5) Here is a screenshot of the debug settings:
I will check out the link you shared and see if I can record some screens for you.
Maybe the above will help.
Truly appreciate your time.
David.
I just downgraded to 2020.1.4 and it seems to be working fine now!!!!!
As soon as I can, I will try re-installing the current version just to make sure that the installation itself didn't fix the problem as opposed to the version.
I will post the result here.
David
I downloaded the current version and the problem returned. Reverted again to 2020.1 and all is good.
Certainly seems to be a bug in the newer release. The following is a screenshot of the validate debugger popup with the server name:
Andriy,
Thanks again for your help.
David.
>I downloaded the current version and the problem returned. Reverted again to 2020.1 and all is good.
So it's an issue with built-in web server -- see the previously mentioned ticket: https://youtrack.jetbrains.com/issue/WI-54542
Try the workaround mentioned there if you want to keep using it: https://youtrack.jetbrains.com/issue/WI-54542#focus=Comments-27-4432669.0-0
TBH (overall): I would suggest to stick to XAMPP. Your students most likely will have it installed anyway (as part of an easy way to get working PHP on Windows for example -- not everybody is OK with downloading PHP archive and making those needed changes in php.ini manually). Plus they will have a proper web server (Apache) that can be configured later to work more like real case web server (own domain for website, so URLs start with just "/" an not "/mywebsite/" prefix; url-rewrite, .htaccess etc).
PhpStorm's built-in webserver is limited and may simply not be able to handle certain scenarios / may contain bugs.
This issue continues to the current versions. When will this be fixed?
There is no ETA available, sorry, please follow WI-54542. By the way, does the workaround work fine for you?
The only solution seems to be downgrading to 2020.1, which is obviously not optimal. Mac OS X Catalina, for reference.