Eclipse IDE for PHP Developers -apache2--XDebug-windows调试设置
第一步,配置apche2。[参考文档,apache的管方文档]
(1)、监听端口是80。
(2)、支持php7
(3)、指定WEB内容根目录,示例如下
第二步,配置本地域名映射,
在 C:\Windows\System32\drivers\etc\hosts 中 给 127.0.0.1 起个域名,如:
第三步,PHP配置支持XDebug。[参考文档:https://xdebug.org/docs/remote]
conf/php.ini增加配置如下 :
[XDebug]
; 打开效能监测器
xdebug.profiler_enable=on
;允许自动跟踪
xdebug.auto_trace=on
xdebug.collect_params=on
xdebug.collect_return=on
;显示异常跟踪
xdebug.show_exception_trace = On
xdebug.collect_vars = On
;指定堆栈跟踪文件的存放目录
xdebug.trace_output_dir="D:\temp\trace"
;设定效能监测信息输出文件的路径
xdebug.profiler_output_dir ="D:\temp\profiler_output"
;允许远程调试
xdebug.remote_enable = On
xdebug.remote_handler = dbgp
xdebug.remote_autostart = On
启动apache2之后,
第四步,eclipse 中配置php的 XDebug调试:参考文档:Eclipse的帮助文档
- (1)、Window/preferences 设置PHP
- (2)设置xdebug.如下图,ports随便填个。但是Proxy 不能错,不然找不到要被调试的host与port。
- (3) 配置Server,其中base URL要填上 host文件里配置的域名。
旁边的Debugger选Xdebug。
- (4)、进行DebugConfiguration配置
另,浏览器安装,比如火狐浏览器XDebug安装了之后: