zoukankan      html  css  js  c++  java
  • phpstorm+Xdebug断点调试PHP

    运行环境:

    PHPSTORM版本 : 8.0.1

    PHP版本 : 5.6.2

    xdebug版本:php_xdebug-2.2.5-5.6-vc11-x86_64.dll

    ps : php版本和xdebug版本一定要相对应

    1. PHP安装xdebug扩展

    php.ini的配置,下面的配置仅供参考,路径要换成自己的!

    zend_extension = "E:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll"
    ;
    [xdebug]
    ;xdebug.remote_enable = off
    ;xdebug.profiler_enable = off
    ;xdebug.profiler_enable_trigger = off
    xdebug.remote_enable = on
    xdebug.profiler_enable = on
    xdebug.profiler_enable_trigger = on
    xdebug.profiler_output_name = cachegrind.out.%t.%p
    xdebug.profiler_output_dir = "c:/wamp/tmp"
    xdebug.show_local_vars=0
    
    xdebug.auto_trace=1
    ;xdebug.collect_params=1
    ;xdebug.collect_return=1
    xdebug.remote_handler = dbgp   
    ;xdebug.remote_autostart = 1
    xdebug.remote_host= localhost
    
    xdebug.remote_port = 19000
    xdebug.remote_autostart=1
    xdebug.idekey = PHPSTORM

    查看phpinfo~

     

    2.PHPSTORM设置

     1.首先检查phpstorm的xdebug配置

              这里的debug port要和php.ini里面的xdebug.remote_port相一致!默认是9000,如果9000端口被占用的话,可以改成其他端口。

    运行环境:

    PHPSTORM版本 : 8.0.1

    PHP版本 : 5.6.2

    xdebug版本:php_xdebug-2.2.5-5.6-vc11-x86_64.dll

    ps : php版本和xdebug版本一定要相对应

    1. PHP安装xdebug扩展

    php.ini的配置,下面的配置仅供参考,路径要换成自己的!

    [xdebug]

    zend_extension="D:wampphp-5.6.2-x64extphp_xdebug-2.2.5-5.6-vc11-x86_64.dll"

    xdebug.remote_enable = On

    xdebug.remote_handler = dbgp   

    xdebug.remote_host= localhost

    xdebug.remote_port = 9000

    xdebug.idekey = PHPSTORM

    ps : remote_handler 、remote_host、remote_port 这些都有默认值,但还是建议设置下,至少知道要设置这些参数~

    查看phpinfo~

    2.PHPSTORM设置

    楼主以前一直用zendstudio,刚开始用phpstorm非常蛋疼,用了一段时间后发现还挺好用的~

            1.首先检查phpstorm的xdebug配置

              这里的debug port要和php.ini里面的xdebug.remote_port相一致!默认是9000,如果9000端口被占用的话,可以改成其他端口。

                    

     

       

    2. 设置debug.

    这是Remote Debug http://51php.xyz/2016/04/20/phpstorm.html

    按F9就可以调试了   F8是单步调试  F7

    javascript:(function(){document.cookie='XDEBUG_SESSION='+''+';expires=Mon, 05 Jul 2000 00:00:00 GMT;path=/;';})()

    javascript:(function(){document.cookie='XDEBUG_SESSION='+''+';expires=Mon, 05 Jul 2000 00:00:00 GMT;path=/;';})()

    IDE key :

     

  • 相关阅读:
    curl
    Bazel 国内镜像源加速下载 + 编译gvisor
    go proxy 代理
    netstack gvisor
    rust libc
    gVisor in depth
    Unikernel
    Unikernel初体验
    github 文本编辑
    cloud-hypervisor coredump
  • 原文地址:https://www.cnblogs.com/wicub/p/5868185.html
Copyright © 2011-2022 走看看