1:首先查看是否安裝xdebug擴展php
打開終端 chrome
➜ ~ php -v
PHP 5.6.24 (cli) (built: Jul 21 2016 14:27:54)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologiesvim
若是沒有安裝怎pecl install xdebug安裝擴展ui
在php.ini文件中添加zend_extension=/usr/lib64/php/modules/xdebug.sospa
2 配置xdebugdebug
vim /etc/php.ini 添加xdebug配置code
xdebug.remote_port = 9000 端口若是修改則需在vscode中的配置文件中修改port選項blog
xdebug.auto_trace=1 默認打開xdebugrem
xdebug.remote_host = "localhost"
xdebug.remote_mode = "req"get
3配置vs code
安裝php debug擴展
設置可用的php路徑
"php.validate.executablePath": "/bin/php"
4在chrome中安裝xdebug helper 擴展程序
5開啓debug