初学php. 因为之前学习前端用了hbuilder, 发现此工具也支持php, 就顺手用了它, 配置xdebug
当然首先hbuilder要安装php插件,
1. 下载安装xdebug
下载地址: https://xdebug.org/download.php
找到自己需要的版本, 下载, 然后放到php安装目录下的ext目录下即可, 然后进行配置
[Xdebug]
;你的xdebug文件路径,不要有空格和中文名之类的就不用再多说了。。
zend_extension=D:/PHP/php-5.4.29-Win32-VC9-x86/php_xdebug-2.2.5-5.4-vc9.dll
;开启自动跟踪
xdebug.auto_trace = Off
;开启异常跟踪
xdebug.show_exception_trace = Off
;开启远程调试自动启动
xdebug.remote_autostart = On
;开启远程调试
xdebug.remote_enable = On
;收集变量
xdebug.collect_vars = Off
;收集返回值
xdebug.collect_return = Off
;收集参数
xdebug.collect_params = Off
xdebug.trace_output_dir="D:/PHP/php-5.4.29-Win32-VC9-x86/Projecs"
xdebug.profiler_enable=Off
xdebug.profiler_output_dir="D:/PHP/php-5.4.29-Win32-VC9-x86/Projecs"
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
2. 配置 hbuilder
工具 --> 选项 --> HBuilder --> 编辑器 --> PHP --> Debug, 将其中的port改为与php.ini文件中的一致, 然后重启服务器即可, 之后打断点的时候就可进入了