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

    1. PHP安装xdebug扩展

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

    [xdebug]
    zend_extension=php_xdebug.dll
    xdebug.remote_handler="dbgp"
    xdebug.remote_autostart=1
    xdebug.show_local_vars=1
    xdebug.dump.GET=*
    xdebug.dump.POST=*
    xdebug.dump.SERVER=*
    xdebug.auto_trace=On
    ; default trace output directory /tmp
    xdebug.collect_vars = On
    xdebug.trace_output_dir=/tmp
    xdebug.collect_params=4
    xdebug.collect_return=On

    xdebug.profiler_enable=Off
    ; default trace output directory /tmp
    ;xdebug.profiler_output_dir=/tmp
    ;xdebug.profiler_enable_trigger=On
    ;test.php?XDEBUG_PROFILE
    xdebug.remote_enable=On
    xdebug.remote_host="localhost"
    xdebug.remote_port=9000
    xdebug.remote_handler="dbgp"
    xdebug.remote_log = "/tmp"
    xdebug.remote_connect_back=1
    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.

                

    添加本地的 web server~

     www.51open.pcom 是我本地的 web server~ ~

    3.开始调试

    1. 打好第一个断点,shift + F9就可以了

    2. 打好第一个断点,选中配置的debug,  按旁边的臭虫 按钮



                        

  • 相关阅读:
    Asp.net SignalR 实现服务端消息推送到Web端
    C#使用Quartz.NET详解
    Ubuntu 安装部署hugegraph
    chapter10.1、异常处理
    chapter13.2、SQLAlchemy
    chapter9.5、描述器
    chapter9.3、可调用对象,上下文管理
    chapter9.4、魔术方法反射
    chapter9.1、魔术方法
    chapter7.1、数据分发与队列queue
  • 原文地址:https://www.cnblogs.com/akidongzi/p/6534933.html
Copyright © 2011-2022 走看看