phpstorm 配置xdebug 调试php代码 详细教程
【php配置】
为php安装xdebug,方法略。
配置文件php.ini
[xdebug]
zend_extension = "c:\xampp\php\ext\php_xdebug.dll"
;开启自动跟踪
xdebug.auto_trace = on
;开启异常跟踪
xdebug.show_exception_trace = on
;开启远程调试自动启动
xdebug.remote_autostart = on
;开启远程调试
xdebug.remote_enable = 1
;收集变量
xdebug.collect_vars = on
;收集返回值
xdebug.collect_return = on
;收集参数
xdebug.collect_params = on
xdebug.trace_output_dir = "c:\xampp\tmp"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "c:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.idekey=phpstorm
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
【phpstorm配置】
File>Settings>Languages&Frameworks>PHP>Servers
添加一个Server。
File>Settings>Languages&Frameworks>PHP>Debug
立即学习“PHP免费学习笔记(深入)”;
看到XDebug选项卡,port填9000,其他默认。
File>Settings>Languages&Frameworks>PHP>Debug>DBGp Proxy
IDE key 填 phpStorm,host 填localhost,port 填82。
浏览器设置(火狐、谷歌使用另外的方式)
衔接 http://www.jetbrains.com/phpstorm/marklets,在左边填上phpStorm,点generate,把下面的链接添加到收藏夹,方便调用。
Run>Edit Configurations
添加Web调试服务器
启动监听
在phpstorm中设置断点后,启动监听,就是电话一样的图标。用chrome浏览localhost中的指定断点的文件,会自动进入断点,在phpstorm中看到调试信息。
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
C++高性能并发应用_C++如何开发性能关键应用
Java AI集成Deep Java Library_Java怎么集成AI模型部署
Golang后端API开发_Golang如何高效开发后端和API
Python异步并发改进_Python异步编程有哪些新改进
C++系统编程内存管理_C++系统编程怎么与Rust竞争内存安全
Java GraalVM原生镜像构建_Java怎么用GraalVM构建高效原生镜像
Python FastAPI异步API开发_Python怎么用FastAPI构建异步API
C++现代C++20/23/26特性_现代C++有哪些新标准特性如modules和coroutines
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号