8

我尝试使用 xdebug 和 NetBeans 来调试 PHP。我开始调试,NetBeans 一直等待与 xdebug 的连接。我的 Mac 上安装了带有最新 MAMP 包的 NetBeans 6.8(最新版本)。

我的 php.ini 看起来像这样:

[xdebug]
;zend_extension="/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
4

7 回答 7

10

最后,我必须像这样添加 idekey 值:

xdebug.idekey="netbeans-xdebug"

现在它可以工作了:-)

于 2009-12-22T15:52:09.967 回答
9

如果您的 php.ini 看起来确实像您发布的内容,您必须取消注释该zend_extension(即删除开头的 ' ;'),以便实际加载 Xdebug。

然后,确保加载了 Xdebug,phpinfo()从 PHP 文件调用(只是为了确定)

之后: 我想应该有一些选项来配置 netbeans 中的调试器?如果是这样,netbeans 是否在端口 9000 上监听?(你在 php.ini 中配置的那个)

于 2009-12-22T14:24:50.177 回答
6

重新启动 Apache 后,以下设置对我在 Mountain Lion 上的 NetBeans 7.2 有效:

zend_extension = /usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so
xdebug.remote_autostart=on 
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey="netbeans-xdebug" 
于 2012-08-23T00:45:40.970 回答
1

Mac/MAMP 用户:如果您已尝试上述所有方法但仍无法正常工作,请重新启动您的 Mac。通过 MAMP 重新启动服务器是不够的。

于 2012-08-29T14:21:29.270 回答
1

我在 XAMPP 1.8.2 和 NetBeans 7.4 中成功使用了以下内容。

[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.idekey="netbeans-xdebug"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = on
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_mode=req
xdebug.remote_host = "localhost"
xdebug.trace_output_dir = "C:\xampp\tmp"
于 2013-12-30T17:04:30.523 回答
0

对我来说是这样工作的(谢谢你们+1)/o/

<pre>
zend_extension = "c:\xampp\php\ext\php_xdebug2.dll"
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_enable=1
xdebug.remote_handler"dbgp"
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey="netbeans-xdebug"
</pre>

配置:
netbeans 7.3 - php 5.4 - xdebug 2.2 - xampp - win7(32bits)

于 2013-04-08T13:51:23.437 回答
0

我已经读到 xdebug 不适用于 OS X 附带的 PHP 版本。我通过使用 php-osx.liip.ch 中的一个方便的包将 php 从 5.4 更新到 5.5 来让它工作,包括预编译xdebug 扩展。使用这个命令:

curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5

请注意,这将使您的默认 php 安装保持不变,但在 httpd.conf 中将其禁用。您的新 php.ini 将位于“/usr/local/php5/lib/php.ini”,xdebug 配置文件位于“/usr/local/php5/php.d/50-extension-xdebug.ini”。

设置:OS X 版本 10.9.2

资料来源: http ://coolestguidesontheplanet.com/upgrade-to-php-5-4-or-5-5-mac-osx-10-8-mountain-lion/

于 2014-03-28T00:02:24.593 回答