sublime Xdebug 配置

Sublime Text 配置x-debug

配置php 的x-debug 拓展

下载地址 :http://www.xdebug.org/download.php

放到php ext的目录下 然后使用再php.ini 中加入extension=php_xdebug.dll

[XDebug]  
zend_extension = "D:wamppphpextphp_xdebug.dll"   
xdebug.remote_autostart=1  
xdebug.remote_enable = On  
xdebug.remote_host = "localhost" #本地服务器  
xdebug.remote_port = 9001        <strong>#默认为9000,防止与php-fpm冲突,改为9001</strong>   
xdebug.remote_handler = "dbgp"  

下载sublime Text Xdebug插件

下载安装

下载地址:https://github.com/martomo/SublimeTextXdebug

使用 package control安装

preference->package Control->install package

配置xdebug client

用sublime 打开你要调试的程序,然后点击导航的project -》save project as 生成一个.sublime-project的文件 然后配置这个文件

{  
    "folders":  
    [  
        {  
            "path": "/D/xampp/htdocs"  #这里应该会自动生成  
        }  
    ],  
    "settings":  
    {  
        "xdebug": {  
            "path_mapping": {  
            },   #本机调试此项不需要设置  
            "url": "http://localhost/xampp/php.php",#这里为xdebug打开的页面  
            "super_globals": true,  
            "close_on_stop": true,  
            "port": 9001   #此port与之前xdebug扩展一致  
        }  
    }  
}  

  调试代码

  • 打断点 在需要打断点的行数使用 shift+f8 打断点
  • 开启debug tools->xdebug->start lance
  • 调试代码 shift+f5

原文地址:https://www.cnblogs.com/tl542475736/p/4275235.html