zoukankan      html  css  js  c++  java
  • subline 配置,本地项目代码下断点来调试远程项目

    参考: https://my.oschina.net/ptk/blog/299464

    1. 文件 tts.sublime-project 的配置如下:

    {
    	"folders":
    	[
    		{
    			"path": "."
    		}
    	],
    	"settings": {
            "xdebug": {
                 "url": "http://localhost",
                 "port": 9004 ,
                 "path_mapping":{  
    
                    "D:/wnmp/www/vidagrid_iot/app/webroot/": "D:/ss/" 
    
                },   
            }
        }
    }
    

    2. 本地项目如下:

    3. 远程项目如下: 

    ------------------------------------------------------------------------

    第四步:配置sublime xdebug

    这一步搞了半天才懂的。

    用sublime打开你要调试的程序,点击sublime导航的Project->save project as。生成一个.sublime-project的文件,修改其为:

    (本地调试)

    Xml代码  收藏代码

    1. {  

    2.     "folders":  

    3.     [  

    4.         {  

    5.             "path": "/D/xampp/htdocs"  #这里应该会自动生成  

    6.         }  

    7.     ],  

    8.     "settings":  

    9.     {  

    10.         "xdebug": {  

    11.             "path_mapping": {  

    12.             },   #本机调试此项不需要设置  

    13.             "url": "http://localhost/xampp/php.php",#这里为xdebug打开的页面  

    14.             "super_globals": true,  

    15.             "close_on_stop": true,  

    16.             "port": 9001   #此port与之前xdebug扩展一致  

    17.         }  

    18.     }  

    19. }  

     (远程调试)

    Xml代码  收藏代码

    1. {  

    2.     "folders":  

    3.     [  

    4.         {  

    5.             "path": "/D/biwebs"  

    6.         }  

    7.     ],  

    8.     "settings":  

    9.     {  

    10.         "xdebug": {  

    11.             "path_mapping": {  

    12.                 "/data/web/dataoa/" : "D:/biwebs/dataoa/"  #与本地就此处不同,必须将远程与本地的映射写明  

    13.             },  

    14.             "url": "http://testdata.zhenai.com/test.php",  

    15.             "super_globals": true,  

    16.             "close_on_stop": true,  

    17.             "port": 9001  

    18.         }  

    19.     }  

    20. }  

    下面来看下效果:

    (本地)

    1.先在试例代码中标记个断点(ctrl+F8)


    2、开启xdebug


    此时浏览器就会打开之前在sublime配置中的url并卡在断点处

    3、调试代码

    ctrl+shift+f5

    变量一目了然展示在眼前,太牛X了,妈妈再也不用担心我调BUG了。

    具体其它操作见https://github.com/martomo/SublimeTextXdebug

  • 相关阅读:
    MFC
    驱动学习
    Ubuntu下为Apache简单配置SSL的方法(HTTPS的实现)
    在linux下helloworld的C程序
    swift安装,linux
    gcc,cc,g++,CC的区别
    ldconfig与 /etc/ld.so.conf
    ubuntu16.04,mysql5.7重启不成功。Restarting mysql (via systemctl): mysql.serviceJob for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service"
    linux .o,.a,.so文件
    zipgateway-2-61-0的安装
  • 原文地址:https://www.cnblogs.com/oxspirt/p/9517606.html
Copyright © 2011-2022 走看看