PHP断点调试

参考文档: https://blog.csdn.net/wangsenling/article/details/107708016

一、远程调试

二、本地调试

就是通过直接执行命令行的方式,例如执行

1
php artisan test

1.设置PHP解释器

image-20220406143105998

2.配置调试脚本

image-20220406143331873

image-20220406143707241

配置Xdebug

配置编辑器

image-20220406144929192

配置php.ini

image-20220406145050561

3.启动侦听

image-20220528103954571

4.PHP8特别注意

php8的配置和PHP7有所差别

1
2
3
4
5
6
7
8
[Xdebug]

#端口
xdebug.remote_port=9000 #php7
xdebug.client_port=9000 #php8

# PHP8新增
xdebug.mode=debug