Remote Xdebug with VirtualBox

后端 未结 6 1270
盖世英雄少女心
盖世英雄少女心 2021-02-02 00:55

I\'m trying to get remote debugging to work. The PHP is running on a VM and I\'m trying to debug from NetBeans on the host machine.

I\'ve followed the instructions here

6条回答
  •  萌比男神i
    2021-02-02 01:18

    What worked for me was running the following from my host:

    ssh -R 9000:localhost:9000 yourUserName@yourVirtualMachine
    

    Note the use of the -R flag instead of -L. I had trouble using port forwarding to get things working, while the ssh tunnel worked perfectly. Note you could also do this by running the ssh command from within the VM and connecting to the host with the -L flag.

    Since I ended up on this question while working with Vagrant, this is the command I personally used, use the password 'vagrant' when prompted:

    ssh -p 2222 vagrant@127.0.0.1 -R 9000:localhost:9000
    

提交回复
热议问题