xDebug似乎确定已安装,但未与NetBeans连接

问题描述:

我现在已经尝试了几个小时,让xDebug(从源代码编译为2.0.5)在使用NetBeans 6.8的MacBook OS X上工作。我已经安装了MAMP,并且正在运行一个小型的PHP(5.2)测试程序,没问题。但是当我尝试调试时,我在Netbeans中得到了这个文本:“等待连接(netbeans-xdebug)”并且没有更多事情发生。 Netbeans被配置为调试器端口9000.在MAMP中没有Zend优化。xDebug似乎确定已安装,但未与NetBeans连接

我都遵循这样的:http://netbeans.org/kb/docs/php/configure-php-environment-mac-os.html#installEnableXdebughttp://www.xdebug.org/docs/installhttp://forums.netbeans.org/topic1513-0-asc-0.html

这里是我的php.ini的一部分

[XDebug] 

;zend_extension="/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so" 

;[Zend] 

;zend_optimizer.optimization_level=15 

;zend_extension_manager.optimizer=/Applications/MAMP/bin/php5/zend/lib/Optimizer-3.3.9 

;zend_optimizer.version=3.3.9 

; Xdebug config for Mac OS X and NetBeans IDE 

zend_extension=/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so 

xdebug.remote_enable=1 

xdebug.remote_handler=dbgp 

xdebug.remote_mode=req 

xdebug.remote_host=localhost 

xdebug.remote_port=9000 

xdebug.idekey="netbeans-xdebug" 

我也读了不少的安装说明等,并的phpinfo表明了XDebug按照V.5.2.11安装好(通过MAMP中的“打开开始页面”)。但是,当我尝试在终端PHP-m我没有看到xdebug列出。我终于认为PHP.INI是从/ etc读取的,所以我将MAMP php.ini复制到php.ini中,从而在那里添加了xdebug.se,localhost,port 9000等信息。之后,当我执行PHP -m时,列出了xdebug IS,但我仍然遇到NetBeans问题。奇怪的PHP -i显示版本5.2.10,而不是上面的5.2.11!

我也试过这个,添加 “于NetBeans XDebug的” 为idekey:Why does xdebug not establish connection with NetBeans?

为什么PHP_INFO()似乎觉得../ MAMP下我的php.ini文件/ ...并没有这样做时,从/ etc读取PMP -m时?

我怎样才能让PHP总是找到MAMP下的INI文件,所以我不必使用两个PHP.INI文件来让PHPINFO()和PHP -m工作?

如何解决NetBeans问题,现在xDebug似乎已正确安装,但仍然无法在NetBeans中运行?有这种需要双php.ini的东西?我可以编译xdebug吗,怎么知道?用xdebug/php的PHP版本的东西?如何检查?

这里是PHP -i的结果的一部分:

xdebug 

xdebug support => enabled 
Version => 2.0.4 

Supported protocols => Revision 
DBGp - Common DeBuGger Protocol => $Revision: 1.125.2.6 $ 
GDB - GNU Debugger protocol => $Revision: 1.87 $ 
PHP3 - PHP 3 Debugger protocol => $Revision: 1.22 $ 

Directive => Local Value => Master Value 
xdebug.auto_trace => Off => Off 
xdebug.collect_includes => On => On 
xdebug.collect_params => 0 => 0 
xdebug.collect_return => Off => Off 
xdebug.collect_vars => Off => Off 
xdebug.default_enable => On => On 
xdebug.dump.COOKIE => no value => no value 
xdebug.dump.ENV => no value => no value 
xdebug.dump.FILES => no value => no value 
xdebug.dump.GET => no value => no value 
xdebug.dump.POST => no value => no value 
xdebug.dump.REQUEST => no value => no value 
xdebug.dump.SERVER => no value => no value 
xdebug.dump.SESSION => no value => no value 
xdebug.dump_globals => On => On 
xdebug.dump_once => On => On 
xdebug.dump_undefined => Off => Off 
xdebug.extended_info => On => On 
xdebug.idekey => pettermagnusson => netbeans-xdebug 
xdebug.manual_url => http://www.php.net => http://www.php.net 
xdebug.max_nesting_level => 100 => 100 
xdebug.profiler_aggregate => Off => Off 
xdebug.profiler_append => Off => Off 
xdebug.profiler_enable => Off => Off 
xdebug.profiler_enable_trigger => Off => Off 
xdebug.profiler_output_dir => /tmp => /tmp 
xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p 
xdebug.remote_autostart => Off => Off 
xdebug.remote_enable => On => On 
xdebug.remote_handler => dbgp => dbgp 
xdebug.remote_host => 127.0.0.1 => 127.0.0.1 
xdebug.remote_log => /tmp/xdebug.log => /tmp/xdebug.log 
xdebug.remote_mode => req => req 
xdebug.remote_port => 9000 => 9000 
xdebug.show_exception_trace => Off => Off 
xdebug.show_local_vars => Off => Off 
xdebug.show_mem_delta => Off => Off 
xdebug.trace_format => 0 => 0 
xdebug.trace_options => 0 => 0 
xdebug.trace_output_dir => /tmp => /tmp 
xdebug.trace_output_name => trace.%c => trace.%c 
xdebug.var_display_max_children => 128 => 128 
xdebug.var_display_max_data => 512 => 512 
xdebug.var_display_max_depth => 3 => 3 

RGDS PM

+0

为了简化问题很多: 任何人都可以想出一个理由塔t当xDebug似乎已安装时,NeatBeans无法连接到xDebug在使用php_info()或php -i和php -m进行检查时,确定是否正常? – 2010-01-06 12:48:53

我从科莫多下载了错误的xDebug.so,不管怎样也是我自己的构建是没有好。再次下载,现在确定。哇,这花了我好几个小时,也没人能帮忙! /PM

How come PHP_INFO() seemed to find my PHP.INI file under ../MAMP/... and not when doing PMP -m when it is read from /etc ? 

phpinfo()使用甲基苯丙胺的PHP程序,而CLI使用您的操作系统之一。

How can I get PHP to always find the INI file under MAMP so I dont have to use two PHP.INI files to et PHPINFO() and PHP -m to work? 

离开OS PHP不变,所以你没有问题的升级和调整的一个与MAMP bubled根据您的需要。

How can I resolve the NetBeans problem now that xDebug seems to be installed correctly but still not working in NetBeans? Something with this need for dual php.ini? Could I have compiled xdebug wrong, how to know? Something with php versions in xdebug/php? How to check? 

下载MAMP的最新版本,其中包括Xdebug扩展编译并添加到您的php.ini

zend_extension="/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so" 
xdebug.remote_host=localhost 
xdebug.remote_port=9001 
xdebug.remote_enable=1 
xdebug.idekey="netbeans-xdebug" 
xdebug.remote_log="/Applications/MAMP/logs/xdebug.log" 

我使用端口9001,因为OSX似乎不喜欢默认。

我检查并重新检查了所有的设置和设置说明,但仍然显示XDebug没有工作。最后,我重新启动了我的Mac,它开始工作。也许这会帮助和我一样的人。

这对我有什么工作

brew install php55-xdebug

  • 抢INI路径,然后粘贴以下到最后
    php -i | grep 'Configuration File'
    vim /usr/local/etc/php/5.5/php.ini

  • 添加以下

    的zend_extension = “/ usr/lib中/ PHP /扩展/无调试非ZTS-20100525/xdebug.so”

    xdebug.default_enable = 1
    xdebug.remote_enable = 1
    xdebug.remote_handler = dbgp 01​​ xdebug.remote_host =本地主机
    xdebug.remote_port = 9001
    xdebug.remote_autostart = 1