zoukankan      html  css  js  c++  java
  • php调试工具——XDebug使用

    下面以windows平台和Aptana Studio为例,介绍XDdebug的使用。

    1、安装XDebug

    1)下载php的XDebug扩展.dll文件,官网下载地址是https://xdebug.org/download.php,可以根据实际php运行系统架构、VC版本和线程安全情况下载。

    2)将下载的.dll文件复制到php安装目录的ext目录下。

    3)打开php.ini文件,添加如下设置:
      xdebug.profiler_append = 0

      ;效能监测的设置开关
      xdebug.profiler_enable = 1
      xdebug.profiler_enable_trigger = 0

      ;profiler_enable设置为1的时候,效能监测信息写入文件所在的目录
      xdebug.profiler_output_dir ="D:phpStudy mpxdebug"

      ;设置的函数调用监测信息的输出路径
      xdebug.trace_output_dir ="D:phpStudy mpxdebug"

      ;生成的效能监测文件的名字
      xdebug.profiler_output_name = "cache.out.%t-%s"

      ;这三行是为了让IDE与XDebug协作
      xdebug.remote_enable = 1
      xdebug.remote_handler = "dbgp"
      xdebug.remote_host = "127.0.0.1"

      ;.dll文件的路径
      zend_extension="D:phpStudyphp54nextphp_xdebug-2.4.0-5.4-vc9-nts.dll"

    4)重启服务器

    2、使用XDebug

    1)打开aptana,window->preferences->php->debug,进行如下设置:

    download.png

    2)window->preferences->php->php interpreters,进行如下设置:

    download2.png

      name为解析器的名字,executable path为php安装目录中php.exe文件路径,php.ini为可选。至此,已设置完毕XDebug。

    3)使用XDdebug

      调试为F11快捷键。

      step into就是单步执行,遇到子函数就进入并且继续单步执行;(F5)
      step over是在单步执行时,在函数内遇到子函数时不会进入子函数内单步执行,而是将子函数整个执行完再停止,也就是把子函数整个作为一步。(F6)
      step return就是单步执行到子函数内时,用step return就可以执行完子函数余下部分,并返回到上一层函 数。(F7)

    现在可以放心地调试php程序了。

  • 相关阅读:
    Sprinig.net 双向绑定 Bidirectional data binding and data model management 和 UpdatePanel
    Memcached是什么
    Spring.net 网络示例 codeproject
    jquery.modalbox.show 插件
    UVA 639 Don't Get Rooked
    UVA 539 The Settlers of Catan
    UVA 301 Transportation
    UVA 331 Mapping the Swaps
    UVA 216 Getting in Line
    UVA 10344 23 out of 5
  • 原文地址:https://www.cnblogs.com/ZDPPU/p/5823899.html
Copyright © 2011-2022 走看看