php - 将 xdebug 与 Netbeans 结合使用来处理 php - 套接字异常

标签 php macos netbeans xdebug

我正在尝试使用 Netbeans 与 xdebug 一起进行 php 调试,但我在 netbeans 中抛出了套接字异常。它正确地停止在断点处,但是当我单击“跳过”或“步入”或任何其他内容时,它将显示套接字异常并崩溃。如果您能提供任何帮助,我们将不胜感激,我花了很多时间试图解决这个问题。

我运行的环境是:

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

来自 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

来自 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"

发生异常时我的IDE日志的输出如下。

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)

最佳答案

您正在运行旧的(且已知损坏的)Xdebug 版本。您想使用最新版本(目前为 2.2.1)。其次,众所周知,XCache 也会干扰 Xdebug,因此您也需要禁用它。

关于php - 将 xdebug 与 Netbeans 结合使用来处理 php - 套接字异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13485566/

相关文章:

swift - NSTableView 行第二次不可点击

javascript - 单击提交按钮后如何保持在同一页面上

java - 文件仅当放置在将从 jar 中删除的位置时才可访问

php - SQL SELECT 和 PHP 检索速度 INT vs TINYINT vs VARCHAR vs ENUM?

php - 如何在 Laravel 4 的主布局中获取当前 View 名称?

macos - 使用 Intellij IDEA 重新加载远程 Spring Boot 应用程序的异常

java - 使用带有 phpmyadmin(wamp) 的 netbeans 的数据库连接问题

php - 如何在 laravel 中对 json 对象进行排序

php - 查看我的数字是否在范围数组中的最佳算法是什么?

perl - 是否有 Mac OS X 默认值的 Perl 接口(interface)?