vscode調試php

  1. xdebug調試vscode
    1. 下載xdebug.dll擴展庫
    2. php.ini配置
      1.   
        1 [XDebug]
        2 xdebug.remote_enable = 1
        3 xdebug.remote_autostart = 1
        4 zend_extension="D:\phpstudy-2018\PHPTutorial\php\php-5.5.38\ext\php_xdebug.dll"

         

    3. vscode 安裝插件 php debug,php xdebug 
      1.   
         1       add configuration:
         2          {
         3             "name": "Listen for XDebug",
         4             "type": "php",
         5             "request": "launch",
         6             "port": 9000
         7         },
         8         {
         9             "name": "Launch currently open script",
        10             "type": "php",
        11             "request": "launch",
        12             "program": "${file}",
        13             "cwd": "${fileDirname}",
        14             "port": 9000
        15         }

         

    4. 調試時有兩個選項:選擇"Listen for XDebug"標示本身打開瀏覽器,輸入網址-進入斷點。php

      選擇"Launch currently open script"標示調試當前文件。瀏覽器

相關文章
相關標籤/搜索