1. 程式人生 > >VS Code 調試 PHP有關配置

VS Code 調試 PHP有關配置

全選 conf 4.2 image -1 spa val org src

一、安裝VS CODE 、 WampServer

二、用VS Code 打開php項目後,提示 "Cannot validate since no PHP executable is set. Use the setting ‘php.validate.executablePath‘ to configure the PHP executable."

解決方法如下:

在“文件”-“首選項”-“設置”下添加:

技術分享

三、在VSCode上安裝:PHP Debug插件:

技術分享

四、安裝 XDebug

   a.新建phpInfo.php文件,如圖

  技術分享

  b.運行,CTRL+A全選,並粘貼到 https://xdebug.org/wizard.php

技術分享

技術分享

技術分享

最後在"C:\wamp\bin\apache\apache2.4.23\bin\php.ini" 內修改為

xdebug.remote_enable = 1
xdebug.remote_autostart = 1
技術分享

五、開始調試,在"C:\wamp\www\index.php"內設置斷點,瀏覽器訪問

技術分享

成功進入!!

 

VS Code 調試 PHP有關配置