Why does xdebug not establish connection with NetBeans?

前端 未结 7 1522
醉梦人生
醉梦人生 2021-01-12 06:15

I try using xdebug with NetBeans to debug PHP. I start debug, and NetBeans waits for ever for a connection with xdebug. I have NetBeans 6.8 (latest version) with the latest

相关标签:
7条回答
  • 2021-01-12 06:32

    Mac/MAMP users: If you have tried all of the above and it still doesn't work, reboot your Mac. Restarting the servers through MAMP is not enough.

    0 讨论(0)
  • 2021-01-12 06:33

    Finally, I had to add the idekey value like this:

    xdebug.idekey="netbeans-xdebug"
    

    now it works :-)

    0 讨论(0)
  • 2021-01-12 06:38

    The following settings worked for me with NetBeans 7.2 on Mountain Lion after restarting Apache:

    zend_extension = /usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so
    xdebug.remote_autostart=on 
    xdebug.remote_enable=on
    xdebug.remote_handler=dbgp
    xdebug.remote_host=127.0.0.1
    xdebug.remote_port=9000
    xdebug.remote_mode=req
    xdebug.idekey="netbeans-xdebug" 
    
    0 讨论(0)
  • 2021-01-12 06:38

    I've read that xdebug doesn't work with the version of PHP what ships with OS X. I got it to work by updating php from version 5.4 to 5.5, using a handy package from php-osx.liip.ch, including precompiled xdebug extension. Use this command:

    curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5
    

    Note that this will leave your default php installation intact, but disable it in httpd.conf. Your new php.ini will be at "/usr/local/php5/lib/php.ini", with the xdebug config file at "/usr/local/php5/php.d/50-extension-xdebug.ini".

    Setup: OS X version 10.9.2

    Sources: http://coolestguidesontheplanet.com/upgrade-to-php-5-4-or-5-5-mac-osx-10-8-mountain-lion/

    0 讨论(0)
  • 2021-01-12 06:41

    If your php.ini really looks like what you posted, you have to un-comment the zend_extension line (i.e. remove the ';' at its begninning), so Xdebug is actually loaded.

    Then, make sure Xdebug is loaded, calling phpinfo() from a PHP file (just to be sure).

    After that : I suppose there should be some options to configure the debugger in netbeans ? If so, is netbeans listening on port 9000 ? (The one you configured in php.ini)

    0 讨论(0)
  • 2021-01-12 06:42

    for me worked this way (thank you guys +1) /o/

    <pre>
    zend_extension = "c:\xampp\php\ext\php_xdebug2.dll"
    xdebug.remote_autostart=on
    xdebug.remote_enable=on
    xdebug.remote_enable=1
    xdebug.remote_handler"dbgp"
    xdebug.remote_host="localhost"
    xdebug.remote_port=9000
    xdebug.remote_mode=req
    xdebug.idekey="netbeans-xdebug"
    </pre>
    

    Config:
    netbeans 7.3 - php 5.4 - xdebug 2.2 - xampp - win7(32bits)

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