Home  >  Article  >  Backend Development  >  [PHP] 如何在NetBeans中使用xdebug来调试php

[PHP] 如何在NetBeans中使用xdebug来调试php

WBOY
WBOYOriginal
2016-06-23 14:29:50692browse

其实,文章的重点是放在了如何配置php的xdebug环境,毕竟环境搭好了,像NetBeans,Eclipse这样的IDE,随便哪个都可以做php的调试的。

 

操作环境:

OS: Ubuntu 10.04

Server: xampp 1.7.3a

 

 

 

1. 下载xdebug.so

方便懒人,不用去编译,所以就提供一个32位的xdebug.so。

http://download.csdn.net/source/2757538

下载好之后,把文件放到(注意这个跟你安装xamp的路径不同而不同,这个是通用的安装路径)

/opt/lampp/lib/extensions

 

 

 

2. 配置php.ini

打开 /opt/lampp/etc/php.ini,添加以下内容

代码

                      <p class="sycode">                          zend_extension      =/      opt      /      lampp      /      lib      /      php      /      extensions      /      xdebug.so[debug]; Remote settingsxdebug.remote_autostart      =      offxdebug.remote_enable      =      onxdebug.remote_handler      =      dbgpxdebug.remote_mode      =      reqxdebug.remote_host      =      127.0      .      0.1      xdebug.remote_port      =      9000      ; Generalxdebug.auto_trace      =      offxdebug.collect_includes      =      onxdebug.collect_params      =      offxdebug.collect_return      =      offxdebug.default_enable      =      onxdebug.extended_info      =      1      xdebug.manual_url      =      http:      //      www.php.netxdebug.show_local_vars      =      0      xdebug.show_mem_delta      =      0      xdebug.max_nesting_level      =      100      ;xdebug.idekey      =      ; Trace optionsxdebug.trace_format      =      0      xdebug.trace_output_dir      =/      tmpxdebug.trace_options      =      0      xdebug.trace_output_name      =      crc32; Profilingxdebug.profiler_append      =      0      xdebug.profiler_enable      =      0      xdebug.profiler_enable_trigger      =      0                      </p>

 

 

 

3. 记得重启服务器!

                  <p class="sycode">                      sudo      /     opt     /     lampp     /     lampp restart                  </p>

 

 

 

4. 用 NetBeans 打开一个项目,添加断点,调试!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn