由于我可用的信息非常稀少,因此我必须更详细地描述设置。
Netbeans 和 xdebug 设置。
Ubuntu 12.04 LTS 精确穿山甲
应该安装什么。


全局设置:
工具 -- 选项


PHP 设置:
使用phpinfo()你得到.. 见下图。

只有一个php.ini 很重要!查看加载的配置文件
如果您将 xdebug 条目写入另一个“php.ini”文件,请务必再次清除所有这些条目。( xdebug 仅在一个 php.ini 中)。还请查看已解析的附加 .ini 文件。我们稍后再谈。
zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000

其他 .ini 文件已解析。
添加或控制,只有第一行必须与“php.ini”中的相同。(不带“”)

确保文件确实存在!

确保session.save_path确实存在!

控制xdebug版本应该等于或更高。(匹配 PHP Version-5.3.10-1 )。如果一切都按照这个答案中的描述完成,但它不起作用,那么很有可能是“xdebug.so”不正确或有缺陷。

创建一个新的 PHP 项目:

项目属性:
源
在我们的测试程序中,项目文件夹和源文件夹完全相同非常重要!

运行配置


开始调试: -- 按调试按钮

默认浏览器打开并保持在Connecting ..状态,而 Netbeans 处于调试模式。
(如果 Netbeans 未打开浏览器或无法连接,请返回Advanced Web Configuration并选择Do Not Open Web Browser。关闭并重新打开浏览器并键入 URL,如下所示)

浏览你的代码。完成调试后,您只会在浏览器中看到一些内容。不要忘记按下停止按钮
。如果你忘记了这个 xdebug 正在运行。
完毕:
