欢迎来到代码驿站!

PHP代码

当前位置:首页 > 软件编程 > PHP代码

解析phpstorm + xdebug 远程断点调试

时间:2021-06-23 09:20:34|栏目:PHP代码|点击:
XDEBUG配置:
1.安装 xdebug 略了。网上有很多资料。
重点写php.ini的配置
[XDebug]
复制代码 代码如下:

zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.default_enable = On
xdebug.collect_params = On
xdebug.remote_connect_back = On           //如果开启此,将忽略下面的 xdebug.remote_host 的参数。 <一台webserver有多个开发者的工作目录的时候使用,如:p1.xx.com,p2.xx.com,p3.xx.com 。。。等。 >
xdebug.remote_host = 192.168.59.104    //注意这里是,客户端的ip<即IDE的机器的ip,不是你的web server>
xdebug.remote_port = 9900                       //      注意这里是,客户端的端口<即IDE的机器的ip,不是你的web server>
xdebug.remote_enable = On
xdebug.remote_handler = dbgp
xdebug.remote_log = "/var/www/xdebug/xdebug.log"
 xdebug.remote_req = req
 xdebug.auto_trace = Off
 xdebug.remote_autostart = On
 xdebug.show_exception_trace = 0
 xdebug.collect_vars = On
 xdebug.collect_return = On
 xdebug.collect_params = On
 xdebug.var_display_max_depth = 15
 xdebug.show_local_vars = 1
 xdebug.dump_undefined = 1
 xdebug.profiler_enable = 1
 xdebug.profiler_output_dir = /var/www/xdebug

PHPSTORM 配置:
1.file->setings->php|Debug右侧。xdebug的那一块。 设置Debug port:9900(这里设置 的是,xdebug 吐出的debug信息,通过本机的什么端口传输。)
2.file->setings->php|Servers  右侧。  host: 你的web服务器的域名或ip ,端口,  下面的 use path mapping  意的是,你的项目的目录,对应服务器上的,什么目录?   这里一定要设置哦! 不然,会发生找不到文件而出错,导至调试终止。
3.Run->Edit Configurations-> 增加一个 PHP WEB APPlication 的调试点。  右侧: server 选择你上面建立的server.  starturl 设置你的入口文件。
至此,配置完毕!
这样的请求,可以注册一个调试客户端哦!
http://www.aihuxi.com/****.php?XDEBUG_SESSION_START=19192
点击,小虫子图标,即可,开始调试!

上一篇:PHP strtr() 函数使用说明

栏    目:PHP代码

下一篇:详解Laravel5.6 Passport实现Api接口认证

本文标题:解析phpstorm + xdebug 远程断点调试

本文地址:http://www.codeinn.net/misctech/146702.html

推荐教程

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:914707363 | 邮箱:codeinn#126.com(#换成@)

Copyright © 2020 代码驿站 版权所有