phpStorm配置postman Xdebug

2023-09-21  本文已影响0人  yichen_china

如果是谷歌流量器调试
需要安装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

现在就可以打断点了。

上一篇下一篇

猜你喜欢

热点阅读