1.在web中输出phpinfo()信息;
2.点击查看网页源代码;全选复制网页源代码
3. 打开网站 Xdebug: Support — Tailored Installation Instructions
然后点击按钮 “Analyse my phpinfo() output”
生成如下内容:
直接点击链接下载即可。
将下载好的文件放在php根目录下面的ext目录下。
4. 配置php.ini
; XDEBUG Extension
[xdebug]
zend_extension ="D:/wamp/bin/php/php7.4.16/ext/php_xdebug-3.0.3-7.4-vc15-x86_64.dll"
xdebug.remote_enable = 1
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="D:/wamp/tmp"
xdebug.show_local_vars=0
xdebug.remote_port=9000
COPY
注意:wamp配置x-debug ,需要修改Apache中的php.ini文件,如果修改php文件下的php.ini会不起作用。
最后重启nginx或apache 输出phpinfo(),搜索xdebug 存在以下信息则配置成功。