Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用NetBeans调试PHP?_Php_Linux_Netbeans_Ubuntu_Xdebug - Fatal编程技术网

使用NetBeans调试PHP?

使用NetBeans调试PHP?,php,linux,netbeans,ubuntu,xdebug,Php,Linux,Netbeans,Ubuntu,Xdebug,更新1: 我在以下方面做了改变: /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" debu

更新1:

我在以下方面做了改变:

/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"
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
phpinfo如下所示:

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"
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
settings,它们与下面第一个答案中描述的一样。然后,我选择一个if语句,单击
ctrl+f8
并添加一个换行符,我不确定下一步该怎么做,因为netbeans中的大多数
debug
run
选项都被禁用


原始问题:

我尝试过遵循许多指南,但似乎无法让netbeans中的php调试正常工作

我已经安装了lamp stack、netbeans、xdebug、netbeans php插件,并在
/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存储库安装的。

您的xdebug设置看起来不错,不过您可能需要添加另一行

xdebug.remote_enable=1
您可能需要检查/更改Netbeans中的一些设置。转到Tools-Options-PHP-General,确认调试器端口设置为9000(与xdebug端口一样),会话id设置为
netbeans xdebug


当您转到调用
phpinfo()
的页面并检查输出中的
xdebug
时,您可以验证xdebug是否正在运行。

您的xdebug设置看起来不错,但可能需要添加另一行

xdebug.remote_enable=1
您可能需要检查/更改Netbeans中的一些设置。转到Tools-Options-PHP-General,确认调试器端口设置为9000(与xdebug端口一样),会话id设置为
netbeans xdebug


当您转到调用
phpinfo()
的页面并检查输出中的
xdebug
时,您可以验证xdebug是否正在运行。

似乎仅适用于php项目,而不是我打开的备用php文件。似乎仅适用于php项目,而不是我打开的备用php文件。