当前位置:首页>开发>正文

如何在HBuilder调试PHP hbliuder怎么打开php

2023-05-23 04:11:55 互联网 未知 开发

 如何在HBuilder调试PHP hbliuder怎么打开php

如何在HBuilder调试PHP

下载安装xdebug
下载适合你的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 =   xdebug.collect_includes =   xdebug.collect_params =   xdebug.collect_return =   xdebug.default_enable =   xdebug.collect_assignments =   xdebug.collect_vars =   xdebug.remote_autostart =   xdebug.remote_connect_back =   xdebug.show_local_vars =   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

hbliuder怎么打开php

1. 很多没有基础的朋友,经常会问php文件怎么打开,其实PHP是一个网页脚本,但不同于html xml 标签语言,直接可以通过浏览器打开,需要有PHP的运行环境才可以访问和打开文件
2. 如果只是编辑PHP打开文件,只需要用记事本或者通过相关的编辑器如(DW、EclipsePHP、editplus 等)打开编辑即可。
3. PHP,是英文超级文本预处理语言Hypertext Preprocessor的缩写。PHP 是一种 HTML 内嵌式的语言,是一种在服务器端执行的嵌入HTML文档的脚本语言,语言的风格有类似于C语言,被广泛的运用。
4. 而HBuilder是DCloud推出的一款支持HTML5的Web开发IDE。 HBuilder的编写用到了Java、C、Web和Ruby。

最新文章