vscode PHP无法调试怎么办

藏色散人
藏色散人 原创
2020-03-31 09:19:17 7193浏览

vscode PHP无法调试怎么办?vscode调试php的方法

xdebug调试vscode

下载xdebug.dll扩展库

php.ini配置

 [XDebug]
 xdebug.remote_enable = 1
 xdebug.remote_autostart = 1
 zend_extension="D:\phpstudy-2018\PHPTutorial\php\php-5.5.38\ext\php_xdebug.dll"

vscode 安装插件 php debug,php xdebug

      add configuration:
           {
              "name": "Listen for XDebug",
              "type": "php",
              "request": "launch",
              "port": 9000
          },
          {
              "name": "Launch currently open script",
             "type": "php",
             "request": "launch",
             "program": "${file}",
           "cwd": "${fileDirname}",
             "port": 9000
         }

调试时有两个选项:选择"Listen for XDebug"标示自己打开浏览器,输入网址-进入断点。

选择"Launch currently open script"标示调试当前文件。

推荐学习:vscode教程

以上就是vscode PHP无法调试怎么办的详细内容,更多请关注php中文网其它相关文章!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。