drkrsx3135168 2012-11-21 02:43
浏览 79
已采纳

使用xdebug和Netbeans进行php - socket异常

I'm trying to get php debugging working with xdebug using Netbeans but I'm getting a Socket Exception thrown in netbeans. It correctly stops at the breakpoint, but when I click to 'step over' or 'step into' or anything, it will display the socket exception and crash. Any help here would be much appreciated, I've spent a great deal of time trying to resolve this.

The environment I'm running is:

Mac OSX 10.7.4
Netbeans IDE 7.2
MAMP Version 2.1.1
php5.4.4
xdebug

From phpinfo:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with XCache v2.0.0, Copyright (c) 2005-2012, by mOo
with Xdebug v2.2.0, Copyright (c) 2002-2012, by Derick Rethans

From php.ini:

xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.remote_log="/Applications/MAMP/logs/xdebug_remote.log"

zend_extension="/Applications/MAMP/bin/php/php5.4.4/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"

The output from my IDE Log when the exception occurs is as follows.

INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.csl.hints.GsfHintsProvider ignored cancel for 266 ms.
INFO [org.netbeans.modules.php.dbgp.URIMapper]: class org.netbeans.modules.php.dbgp.URIMapper$1: /Applications/MAMP/htdocs/glog/index.php -> file:///Applications/MAMP/htdocs/glog/index.php
INFO [org.netbeans.modules.php.dbgp.URIMapper]: class org.netbeans.modules.php.dbgp.URIMapper$1: /Users/Manachi/Work/myapp/index.php -> file:///Users/Manachi/Work/myapp/index.php
INFO [org.netbeans.modules.php.dbgp.URIMapper]: class org.netbeans.modules.php.dbgp.URIMapper$1: /Users/Manachi/Work/adwaf/php/adwaf/portal/index.php -> file:///Users/Manachi/Work/adwaf/php/adwaf/portal/index.php
INFO [org.netbeans.modules.php.dbgp.URIMapper]: class org.netbeans.modules.php.dbgp.URIMapper$1: file:///Users/Manachi/Work/adwaf/php/adwaf/portal/index.php -> /Users/Manachi/Work/adwaf/php/adwaf/portal/index.php
SEVERE [org.netbeans.modules.php.dbgp.packets.DbgpMessage]
SEVERE [org.netbeans.modules.php.dbgp.packets.DbgpMessage]
INFO [org.netbeans.modules.php.dbgp.DebugSession]
java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:124)
    at org.netbeans.modules.php.dbgp.packets.DbgpCommand.send(DbgpCommand.java:92)
    at org.netbeans.modules.php.dbgp.DebugSession.sendCommands(DebugSession.java:211)
[catch] at org.netbeans.modules.php.dbgp.DebugSession.run(DebugSession.java:143)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
  • 写回答

1条回答 默认 最新

  • dongzhen6554 2012-11-21 12:37
    关注

    You're running an old (and known broken) version of Xdebug. You want to use the latest (2.2.1 at the moment). And secondly, XCache is known to interfere with Xdebug as well, so you will want to disable that too.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog