PHPStorm unable to make external connection with x

2020-02-12 04:01发布

问题:

My OS is Mac Mountain lion.

My PhpStorm version is 5.0.4.

Here is my php xdebug info:

  • xdebug.remote_autostart => Off => Off
  • xdebug.remote_connect_back => Off => Off
  • xdebug.remote_cookie_expire_time => 3600 => 3600
  • xdebug.remote_enable => On => On
  • xdebug.remote_handler => dbgp => dbgp
  • xdebug.remote_host => 127.0.0.1 => 127.0.0.1
  • xdebug.remote_log => data/logs/xdebug.log => data/logs/xdebug.log
  • xdebug.remote_mode => req => req
  • xdebug.remote_port => 9000 => 9000
  • xdebug.idekey => no value => no value

I can debug PhpScript Run Type in PhpStorm,It works fine.So I think xdebug configure well.

But after I try follow the "Zero Configure Debug"(Which with Webapplication Run Type),Phpstorm can not connect with the incoming connection.

Here is my step:

  1. Click Start Listion Php Connection.(Toggle the call to green)
  2. Click Run->Break at first line in PhpScript,and set breakpoint at first statement.
  3. Choose My WebApplication Config and click Debug button.Then it launches chrome and link to my phpscript.(with ?XDEBUG_SESSION_START=19869)
  4. In PhpStorm,Debugger shows Waiting for incoming connection with ide key '19869'.
  5. In termial,printlsof -i4TCP:9000.

    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    webide 288 wangfeng 69u IPv6 0xa83881cdce30c579 0t0 TCP *:cslistener (LISTEN)

  6. Open Chrome's Developer Tool,Select Cookies.

    XDEBUG_SESSION 19869 localhost / Wed, 30 Jan 2013 05:27:17 GMT 19

  7. Refresh Chrome.Not able connect with PhpStorm debug connection.

Additional:

  • My firewall was closed.
  • My Server is nginx.My phpwebapp and server is all at my local machine.

Does it cause ipv6?

Hopes help!I have try everything,extensions bookmarklets,not work at all.

回答1:

It's possible that port 9000 is being used by some other process.

  1. In php.ini set xdebug.remote_port=9001 or another unused port of your choosing.
  2. In PHPStorm go to Settings->PHP->Debug and under the Xdebug section set Debug port to 9001.
  3. Restart your web server.
  4. Start debugging.


回答2:

After checking all the configuration in php.ini file and the IDE, do not forget to add the browser-specific extension that basically communicates via the IDE via IDE Key.

Please refer to this link