前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >使用postman时phpstorm如何debug?

使用postman时phpstorm如何debug?

原创
作者头像
槽痞
修改2020-06-01 14:28:17
1.3K0
修改2020-06-01 14:28:17
举报
文章被收录于专栏:PHP开发者那些事

很多人不知道的是,php框架如thinkphp,laravel等都是可以debug的。

首先需要下载对应的xdebug配置文件,并且在在php.ini中配置好相关参数

附xdebug配置:

代码语言:txt
复制
[XDebug]
xdebug.profiler_output_dir="D:\phpStudy\tmp\xdebug"
xdebug.remote_enable=1
xdebug.trace_output_dir="D:\phpStudy\tmp\xdebug"
xdebug.remote_host=app.cn //给框架配置的配置的vhost
zend_extension="D:\phpStudy\php\php-7.1.16-nts\ext\php_xdebug.dll"
xdebug.idekey = "PHPSTORM"

xdebug.profiler_enable_trigger_value=PHPXDEBUG
xdebug.profiler_enable_trigger=1
xdebug.profiler_enable=on
xdebug.remote_connect_back=on
  • 首先配置好xdebug等相关的,如果能够用浏览器debug的话,就说明配置好了
  • 打好断点,使用postman进行debug时只需要在你的url后面加上一个get参数:?XDEBUG_SESSION_START=PHPSTORMurl?XDEBUG_SESSION_START=PHPSTORM,这个时候就会进入断点。

-------------更新phpstorm下cli模式的debug----------------------

代码语言:txt
复制
php -dxdebug.remote_enable=1 -dxdebug.remote_autostart=on -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 artisan my:command

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档