I'm using Xdebug on a virtual machine (Ubuntu guest). I'm using Vagrant to manage these VM and I'm configuring a "pattern" OS to clone it for web develop. The problem is that I want to configure this ubuntu guest to accept connection to xdebug from any host (xdebug is obviously in the guest os).
These instructions don't work:
zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_connect_back=1
xdebug.remote_port=9000
The only way seems to add a line with:
xdebug.remote_host=sdurzu
"sdurzu" is the hostname of the host, but I want to create an "universal" configuration for xdebug, not based on host name or IP.
Is there a way to use a wild card (*) or something like this?
When Xdebug is running, it will call back to your IDE (like PhpStorm or VS Code) from the server where it's running. Your IDE will sit and listen for that connection on a specific port (typically port 9000 or 9003).
Port 9003 is the default for both Xdebug and the Command Line Debug Client. As many clients use this port number, it is best to leave this setting unchanged.
Verify that Xdebug is properly running by checking again with phpinfo() or php -v as explained above. Note that 9003 is the default port. If this port is used by another service on your system, change it to an unused port. After adding these settings, restart your webserver again.
According to the Xdebug settings documentation, remote_host
is ignored if you have remote_connect_back
enabled.
xdebug.remote_connect_back
Type: boolean, Default value: 0, Introduced in Xdebug >= 2.1If enabled, the xdebug.remote_host setting is ignored and Xdebug will try to connect to the client that made the HTTP request. It checks the $_SERVER['HTTP_X_FORWARDED_FOR'] and $_SERVER['REMOTE_ADDR'] variables to find out which IP address to use.
[...]
Also, remote_connect_back
should allow any device to connect to Xdebug that has access to your web server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With