Laragon集成开发环境+配置Xdebug+postman运行Xdebug

[ Laravel 5.5 文档 ] 快速入门 —— 使用 Laragon 在 Windows 中搭建 Laravel 开发环境:http://laravelacademy.org/post/7754.html

下载:https://www.laragon.org/download/

 安装完成后

创建项目

在D:laragonwww新建一个文件夹aa,重启Laragon服务,即可

 

菜单带有很多功能

Nginx->dir:alias  会进入D:laragonetc ginxalias

我们可以跳到D:laragonetc ginxsites-enabled

像auto.aa.test.conf就是我创建的一个网站后的配置了,打开文件

这里可以修改对应的域名和指向的项目入口

问题解决:

访问不了,或必须带8080访问

Nginx默认访问端口设为80

现在来打开xdebug调试功能

首先在谷歌浏览器安装Xdebug扩展

 

当前php版本也需要支持Xdebug

 php.ini最后加

[xdebug]
zend_extension="D:laragoninphpphp-7.1.14-Win32-VC14-x64extphp_xdebug-2.6.0-7.1-vc14-x86_64.dll"
xdebug.remote_enable=true     
xdebug.remote_host=127.0.0.1  
xdebug.remote_port=9000       
xdebug.remote_handler=dbgp
xdebug.idekey="PHPSTORM"

  

下载安装:php_xdebug-2.6.0-7.1-vc14-x86_64.dll

链接:https://pan.baidu.com/s/1MsJ6C7kXwceL4PgWACzWxA 密码:h9tu

https://xdebug.org/download.php

放到对应php的ext文件夹下即可

执行php -m

使用一下Laragon的cmd终端

 打开phpstorm

 Run->Break at first line in PHP scripts

然后打个断点

浏览器请求对应页面,回到phpstorm,已经跳到对应断点

Xdebug变量跟踪

Run->Evaluate Expression

 Evaluate Expression

 是不是很方便,很强大哈哈!

补充:postman Xdebug

有时我们需要测试post之类的请求,就需要用到postman了,那posytman怎么使用phpstorm的xdebug呢

首先谷歌要装一下Postman和Postman Interceptor

打开谷歌浏览器右上角的postman Interceptor扩展

打开 更多工具-》扩展程序-》postman,再启动右上角的监控图标

 然后设置断点,再在postman访问即可

原文地址:https://www.cnblogs.com/cxscode/p/8933209.html