深井冰_01
深井冰_01
  • 发布:2015-01-22 16:23
  • 更新:2020-09-06 10:50
  • 阅读:8016

如何调试PHP

分类:HBuilder

下载安装xdebug

  • http://xdebug.org/download.php 下载适合你的PHP版本的xdebug 
  • 复制到php安装目录的ext文件夹,改名为php_xdebug.dll  
  • 配置xdebug
      在php.ini尾部添加如下
      [xdebug]
      zend_extension="php_xdebug.dll"
      xdebug.remote_enable = On
      xdebug.remote_host = "localhost"
      xdebug.remote_port = 9000
      xdebug.remote_handler = "dbgp"
      xdebug.auto_trace = 1
      xdebug.collect_includes = 1
      xdebug.collect_params = 1
      xdebug.collect_return = 1
      xdebug.default_enable = 1
      xdebug.collect_assignments = 1
      xdebug.collect_vars = 1
      xdebug.remote_autostart = 1
      xdebug.remote_connect_back = 1
      xdebug.show_local_vars = 1
      xdebug.show_exception_trace = 0
      运行phpinfo();看有xdebug模块信息出来就是搞定了。

    配置HBuilder支持xdebug

    这里的配置很重要
      选择工具 → 选项→ HBuilder→编辑器→ PHP →Debug 双击 Xdebug,弹出对话框如下图


    Debug Port 设为跟php.ini中设置的一样(默认是9000)。
      Accept remote session(JIT) 选择localhost
      允许浏览器访问网站时zend studio自动打开文件开始调试。
      选项说明:
      off: 关闭浏览器访问时打开调试功能;
      localhost: 通过localhost访问网页的时候打开调试。
      any:只要访问服务器上的php都打开调试;
      prompt:访问服务器上的php时弹出询问是否要调试。
      一旦打开HBuilder允许xebug调试,所有访问php页面都会进入调试。如果你不喜欢这样,可以安装chrome xdebug helper 或 fire fox的easy xdebug参见http://www.weste.net/2013/2-24/89256.html
      

1 关注 分享
5***@qq.com

要回复文章请先登录注册

4***@qq.com

4***@qq.com

简单这里有方法 有教程:

https://jingyan.baidu.com/article/1612d500676ccfa30e1eee95.html
2020-09-06 10:50
2***@qq.com

2***@qq.com

我按照这个配置配置不出来,搭配的xmapp hbuilbe 进度到百分之25,就不动了,调试没反应,求解决
2016-09-01 19:34
gwznet

gwznet

先配置用用看
2016-01-17 17:19