2011-07-26 44 views
1

更新1:使用NetBeans调试PHP?

我已在发生变化:

/etc/php5/apache2/conf.d/xdebug.ini 

看起来是这样的:

zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so 
xdebug.remote_enable=On 
xdebug.remote_enable=1 
xdebug.remote_host="localhost" 
xdebug.remote_port=9000 
xdebug.remote_handler="dbgp" 

的phpinfo看起来是这样的:

debug   
xdebug support  enabled 
Version  2.0.5 
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 no value  no value 
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 localhost  localhost 
xdebug.remote_log no value  no value 
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 

我有检查netbeans tools > options > php设置,它们如下面第一个答案中所述。然后我选择if语句,单击ctrl+f8添加一个换行符,并且我不确定接下来要做什么,因为netbeans中的大部分debugrun选项都被禁用。


原题:

我已经尝试了以下许多导游,但我似乎无法获得在NetBeans PHP调试工作

我已经安装LAMP堆栈,NetBeans中的XDebug ,PHP的NetBeans插件,并添加以下内容/etc/php5/apache2/conf.d/xdebug.ini

zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so 
xdebug.remote_enable=On 
xdebug.remote_host="localhost" 
xdebug.remote_port=9000 
xdebug.remote_handler="dbgp" 

如果我再重新启动的Apache2和负载netbeans并打开一个php页面并添加一个断点,所有调试和运行选项在netbeans中被禁用...

我在做什么错?

我使用的是Ubuntu 10.04,并且所有内容都通过标准的ubuntu存储库进行安装。

+0

请参阅上面的更新1。 – oshirowanen

回答

1

你Xdebug的设置似乎很好,虽然你可能需要添加另一条线路

xdebug.remote_enable=1 

而且你可能需要检查/ Netbeans中更改一些设置。转至工具 - 选项 - PHP - 常规,并验证调试器端口设置为9000(因为是您的xdebug端口)并且会话ID设置为netbeans-xdebug

您可以验证xdebug是否在运行时页面调用phpinfo()并在输出中检查xdebug

+0

请参阅上面的原始问题更新1。 – oshirowanen

+0

似乎只为PHP项目工作,而不是如果我打开一个站点沿着PHP文件。 – oshirowanen