Techiio-author
Started by Bell GrantNov 3, 2021

Open
How to debug connections from virtual machine

1 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 1 VIEWES SHARE

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

Techiio-commentatorHarry Lian replied 3 months ago0 likes0 dislikes

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

You must be Logged in to reply
Trending Technologies
15
Software40
DevOps47
Frontend Development24
Backend Development20
Server Administration17
Linux Administration26
Data Center24
Sentry24
Terraform23
Ansible83
Docker70
Penetration Testing16
Kubernetes21
NGINX20
JenkinsX17
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance