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.

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

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大