I'm in the process of setting up a Vagrant environment using puppet for provisioning.
I'm stuck with one issue, I would like xdebug to 'just work' when running vagrant up
however I need to specify the host machines ip address in the php.ini file xdebug.remote_host
, obviously this is going to be different on each machine the config is used so I would like a way to automatically update that value when issuing vagrant up
.
VagrantFile:
config.vm.network :forwarded_port, guest: 9000, host: 9000
.ini settings:
'xdebug.default_enable=1',
'xdebug.remote_enable=1',
'xdebug.remote_handler=dbgp',
'xdebug.remote_host=localhost:9000',
'xdebug.remote_port=9000',
'xdebug.remote_autostart=0',
'xdebug.max_nesting_level=250'
I have also tried it with xdebug.remote_host=localhost
ifconfig results from the vagrant machine:
vagrant@precise64 ~ : ifconfig
eth0 Link encap:Ethernet HWaddr 00:0c:29:cf:f9:89
inet addr:192.168.61.142 Bcast:192.168.61.255 Mask:255.255.255.0
phpinfo()
REMOTE_ADDR 192.168.61.2
REMOTE_PORT 51886
Just to confirm, if I give remote_host
my actual ip address I have on my osx host machine, it works correctly.