mac sublime3+xdebug+firefox调试环境的搭建

来源:互联网 发布:新手怎么装修淘宝店铺 编辑:程序博客网 时间:2024/04/29 16:23

第一步:配置php xdebug扩展

[xdebug]
zend_extension=/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.idekey="sublime.xdebug"
xdebug.remote_log="/var/log/xdebug/xdebug.log"


第二步:安装sublime xdebugclient(不是xdebug)


第三步:安装php xdebug扩展

sublime中安装sublime xdebug client,此处一定要安装带client的,而不是sublime xdebug。注意安装完成后,在sublime中ctrl+shift+p  ,输入xdebug,如果出现以下这些选项,则已经安装成功。

第四步:配置sublime xdebug

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


下面是我的MAC配置

{
  "folders":
  [
    {
      "path": "/Applications/xampp/xamppfiles/htdocs"
    }
  ],
  "settings":
  {
    "xdebug": {
  "path_mapping": {
  },   
  "url": "http://127.0.0.1/test.php",
  "super_globals": true,
  "close_on_stop": true,
  "port": 9000   
        }
  }
}


第五步:下载firebox插件easiest Xdebug

点击绿色的小爬虫,点亮代表调试状态开启,第一次不点击开启,调试无效


第六步:测试调试

 在待调试的文件中加断点之后,在sublime中 tools --> xdebug  --> 开始调试 。此时在浏览器中开上面配置步骤中所设置的url:http://127.0.0.1/test.php,进入断点,完成调试。

0 0
原创粉丝点击