美文网首页
phpStorm配置postman Xdebug

phpStorm配置postman Xdebug

作者: yichen_china | 来源:发表于2023-09-21 13:38 被阅读0次

    如果是谷歌流量器调试
    需要安装Xdebug插件
    这个插件主要是在Cookie添加了XDEBUG_SESSION=PHPSTORM;

    如果是用户postman调试
    在header添加一条Cookie配置
    参数名:Cookie
    参数值:XDEBUG_SESSION=PHPSTORM;

    php.ini
    配置如下:

    [XDebug]
    xdebug.profiler_append = 0
    xdebug.profiler_enable = 1
    xdebug.profiler_enable_trigger = 0
    xdebug.profiler_output_dir ="D:\BtSoft\temp\xdebug"
    xdebug.trace_output_dir ="D:\BtSoft\temp\xdebug"
    xdebug.profiler_output_name = "cache.out.%t-%s"
    xdebug.remote_enable = 1
    xdebug.remote_handler = "dbgp"
    xdebug.remote_host = "127.0.0.1"
    xdebug.remote_port=9000
    ; 远程自动启动,我们设置的是1,也就是启动
    xdebug.remote_autostart = 1
    ;自动跟踪,我们设置的也是1,也就是自动跟踪
    xdebug.auto_trace=1
    xdebug.remote_connect_back = 1 
    xdebug.idekey = PHPStorm
    zend_extension=php_xdebug.dll
    xdebug.mode=debug
    

    宝塔后台点击安装xdebug,其他基本都是自动安装的。
    需要手动添加的是

    xdebug.mode=debug
    

    phpStorm配置
    php配置版本,选自己配置好php.ini的那个版本
    设置->php->调试
    几个红色地方需要注意


    image.png

    验证Xdebug,是否配置好
    点验证
    点->本地web服务器或共享文件夹(L)
    把路径配置成自己的php项目入口目录。

    验证脚本url 写要调试的网址。
    点验证全是对号,代表通过。

    监听要打开


    image.png

    发现客户端主机:关闭 这个不用管。
    配置Xdebug调试端口 9000或者其他,这个需要与php.int xdebug.remote_port=9000 一样。

    phpStorm 服务器配置
    设置->php->服务器
    点加号
    主机地址端口就是web的访问地址。
    调试器 Xdebug

    现在就可以打断点了。

    相关文章

      网友评论

          本文标题:phpStorm配置postman Xdebug

          本文链接:https://www.haomeiwen.com/subject/qelzvdtx.html