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 Stata链式中介效应代码修改
  • ¥15 latex投稿显示click download
  • ¥15 请问读取环境变量文件失败是什么原因?
  • ¥15 在若依框架下实现人脸识别
  • ¥15 网络科学导论,网络控制
  • ¥100 安卓tv程序连接SQLSERVER2008问题
  • ¥15 利用Sentinel-2和Landsat8做一个水库的长时序NDVI的对比,为什么Snetinel-2计算的结果最小值特别小,而Lansat8就很平均
  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错