I have got a website (say, test.Com) with a personal home page code running on Ubuntu with Nginx. I can debug it via phpstorm and xdebug2. And now I need to debug it (particularly, use breakpoints in phpstorm) while requests are going from my VMware device with home windows 10. For instance, I can run test.com in the guest machine's browser and it'll show the website, however, at the same time, debug or phpstorm don't forestall at breakpoints.
1 Replies
Thanks for the commenters: I updated Xdebug to 3rd version and now it's working with VM connections too.
virtual-machine
phpstorm
debug
Share
Improve this question
Follow
edited Nov 6, 2021, at 1:51
asked Nov 3, 2021, at 9:18
user avatar
qloq
48211 gold badge44 silver badges1212 bronze badges
In PHP, it's the debugger that initiates a connection to the IDE, not the other way around. You need to set debug.remote_host to an IP/hostname the virtual machine can use to connect to the host. For VMware, usually, it's an IP of the VMnet* adapter your VM is using. –
Eugene Morozov
Nov 3, 2021 at 12:16
@Eugene Morozov, Please look at the updated part of the question, maybe I have misunderstood which IP to use –
qloq
Nov 3, 2021 at 19:59
Uh-oh. I think I've gotten the setup wrong. So, your host is Ubuntu, and the guest is Windows? And the webserver is on the host, while PhpStorm is in the VM? Usually, it's the other way around. Okay then. By default, guests in VMware are using NAT networking, which means that you cannot connect to them directly. You need to create a host-only network for the VM and then use the guest IP assigned by this network as remote_host instead. You can use telnet IP 9003 on the host while Listening for PHP debug connections is enabled in PhpStorm to find out whether the IP is correct or not –
Eugene Morozov
Nov 3, 2021 at 23:10
No) Everything development-related is running on Ubuntu-host - Nginx, PHP, debug, PHPStorm. I just need to send HTTP requests to my web app from Windows VM. –
qloq
Nov 4, 2021 at 1:55
2
Please upgrade to Xdebug 3 too, and see what xdebug_info() tells you in a request that you're trying to debug. Xdebug 2 is no longer supported. –
Derick
Nov 4, 2021 at 9:42