zoukankan      html  css  js  c++  java
  • 在Intellij IDEA或者PhpStorm下用X-debug调试PHP

    用Intellij IDEA或者PhpStorm使用X-debug来调试PHP,主要需要配置的部分有三个地方,分别为php.ini的配置,IDEA的配置和浏览器的配置,主要如下,以备忘:

    • .ini的主要配置如下所示,关键参数根据实际情况可以修改:
      []
      zend_extension_ts=”X:/App/php-5.2.17-Win32-VC6-x86/ext/php_xdebug-2.1.1-5.2-vc6.dll”
      xdebug.remote_host=jichengdiaoding.com
      xdebug.remote_port = 9000
      xdebug.remote_mode = “req”
      xdebug.remote_enable = on
      xdebug.remote_handler = dbgp
      xdebug.idekey = “netbeans-xdebug”
      xdebug.profiler_enable=on
      xdebug.trace_output_dir=”X:/App/php-5.2.17-Win32-VC6-x86/xdebuginfo”
      xdebug.profiler_output_dir=”X:/App/php-5.2.17-Win32-VC6-x86/xdebuginfo”
      xdebug.auto_trace=on
      xdebug.collect_params=on
      xdebug.collect_return=on
      xdebug.show_exception_trace = On
      xdebug.remote_autostart = On
      xdebug.collect_vars = On配置好了,在CMD里面输入X:/App/php-5.2.17-Win32-VC6-x86/php.exe -m,如果能看到XDebug模块,说明开启成功。
      *: 值得注意的是,这里需要确定好XDebug和PHP的对应版本
    • IDEA的配置如下:
      进入File>Settings>PHP>Servers,这里要填写服务器端的相关信息,name填要调试的主机名 (如:jichengdiaoding.com或者localhost等),host填(如:localhost或者amiku.cn等),port填 80,debugger选XDebug

      进入File>Settings>PHP>Debug,看到XDebug选项卡,port填9000,其他默认

      进入File>Settings>PHP>Debug>DBGp Proxy,IDE key 填 netbeans-xdebug,host 填jichengdiaoding.com,port 填80
    • 在Firefox或者Chrome浏览器中,找到对应的X-Debug版本的插件,如下为Firefox下的调试插件:

      工具的设置里的IDE KEY填上netbeans-xdebug,把jichengdiaoding.com加入到白名单,以后调试的时候把工具启用就好了

      在IDEA中打开PHP的监听,然后就可以进入debug模式,方便的打断点和查看变量以及监测等。
    •  配置完成。
  • 相关阅读:
    利用javabean完成注册效果
    DAO设计模式例子
    SmartUpload使用和简介
    js和jquery通过this获取html标签中的属性值
    细说引用类型string StringBuilder class的特点
    WinForm控件自动提示你定义相似的项值
    利用Assembly动态加载程序集
    C# 数据结构与算法系列(五) 队列
    ASP.NET最简单的用户权限管理
    C# 数据结构与算法系列(三) 线性表之链表
  • 原文地址:https://www.cnblogs.com/wawahaha/p/4330437.html
Copyright © 2011-2022 走看看