Search code examples
phpremote-debuggingphpstorm

phpStorm remote debugging selecting sending wrong ip address during remote debug


does anyone know how to set the interface ip that phpstorm sends for remote debug? I am debugging a remote site and it keeps sending a wrong interface (i have several )

when i start the debug it starts the browser :

http://192.168.0.251/?start_debug=1&send_sess_end=1&debug_start_session=1&debug_session_id=19689&debug_port=10137&debug_host=169.254.98.211%2C127.0.0.1&debug_stop=1

the ip address 169.254.98.211 should be 192.168.0.135 and if i change it manually, it works !

so where do i set this??

Khan


Solution

  • When using PHP Web Application Debug configuration, the value of the debug_host cannot be defined by the user, it's hardcoded:

      public static String getDebugHost() {
        try {
          final InetAddress localHost = Inet4Address.getLocalHost();
          return localHost.getHostAddress() + ",127.0.0.1";
        }
        catch (UnknownHostException e) {
          return "127.0.0.1";
        }
      }
    

    A workaround would be to use Zero-configuration Debugging where you can define the host IP address in the bookmarklet generator. Don't get confused by the xdebug, it's almost the same for Zend Debugger.