Phpstorm, xdebug and vagrant still waiting for incoming connection

后端 未结 3 907
小鲜肉
小鲜肉 2020-12-18 23:39

This is annoying me, mainly because it was working fine then all of a sudden breakpoints stopped breaking and when i checked debugger it was just waiting for incoming connec

相关标签:
3条回答
  • 2020-12-19 00:00

    I had a problem very similar with my two hosts on remote server.

    One was called dev.host.com, the other 123.host.com (which was corresponding to a temporary version number).

    My problem was that dev.host.com was working perfectly fine with xdebug in phpstorm while the other host was always waiting for incoming connection.

    I spent some hours to look why, but found nothing concluant by changing my xdebug parameters, my phpstorm conf, my folders permissions,... until I renamed my 123.host.com with some alphabetical characters like 'abc.host.com' and..... it started working !

    So I would advise you to be careful with the name you choose for your host, I think it was not mapped correctly... Weird but solved on my side.

    0 讨论(0)
  • 2020-12-19 00:09

    Had identical problem, what helped me is setting :

    xdebug.remote_autostart = 1
    

    my other settings are:

    zend_extension=xdebug.so
    xdebug.remote_enable=1
    xdebug.remote_connect_back=1
    xdebug.remote_port=9010
    xdebug.idekey=phpstorm
    xdebug.remote_autostart = 1
    xdebug.remote_handler=dbgp
    xdebug.remote_host=10.0.2.2
    
    0 讨论(0)
  • 2020-12-19 00:13

    You say you have a server setup pointing to port 80? That could be the problem.

    I have a vagrant server setup in PHPstorm which has a host of dev.website.com which points at the correct IP in windows host file, the port is 80 and the folders are mapped correctly.

    Do you use PHP Remote Debug?

    If it's the server setup from the screenshot, change the port there to 9020 or whatever you desire to use.


    My First steps of checking why xDebug isn't working:

    Set Break at first Line in the PHPStorm preferences

    preferences->languages&frameworks->PHP->debug ( search break at first )

    Enable the break at first Line feature

    Still not working?

    What does your phpinfo say? Is xDebug enabled and do all the settings match?

    phpinfo()
    

    If not try this https://xdebug.org/wizard.php and check out this Tutorial

    If so try

    Is there maybe a firewall blocking your port?

    No? ok ->

    vagrant ssh 
    netstat -an | grep 9000
    

    Check if the port is listening and is not blocked by anything.

    I would recommend using port 9000, had issues with others.

    I recently had an issue with hhvm blocking the port. I purged it from the system.

    If everything looks fine, try to use phpstorms remote debug feature and map explicitly your index.php file of your project/s.


    Also maybe try not to use numeric values as your idekey

    XDEBUG_SESSION_START=18359

    Most people use something like this:

    XDEBUG_SESSION_START=PHPSTORM

    you can add an idekey to your xdebug.so would look like this

    xdebug.idekey=PHPSTORM
    

    Small list with xdebug parameters: https://xdebug.org/docs/basic

    My current projects phpstorm config looks like this:


    This is a plugin for setting the session cookie in the browser https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc

    0 讨论(0)
提交回复
热议问题