1、下载netbeans(编辑器)
2、配置xdebug,下载地址:https://xdebug.org/download.php。php版本,TS 和NTS,VC9和VC11,32位和64位都需要正确才可以。(看下图下载所需版本)
3、配置php.ini文件
参数说明:
;指定Xdebug扩展文件的绝对路径
zend_extension=D:/phpext/php_xdebug-2.4.1-5.4-vc9.dll
;启用性能检测分析
xdebug.profiler_enable=On
;启用代码自动跟踪
xdebug.auto_trace=on
;允许收集传递给函数的参数变量
xdebug.collect_params=On
;允许收集函数调用的返回值
xdebug.collect_return=On
;指定堆栈跟踪文件的存放目录
xdebug.trace_output_dir="D:/debug"
;指定性能分析文件的存放目录
xdebug.profiler_output_dir="D:/debug"
xdebug.profiler_output_name = "cachegrind.out.%p"
xdebug.remote_enable = On
xdebug.remote_port=9000
xdebug.remote_handler = dbgp
xdebug.remote_host = localhost
xdebug.var_display_max_depth = 10
配置成功的例子
[XDebug]
xdebug.profiler_output_dir="D:\phpStudy\tmp\xdebug"
xdebug.trace_output_dir="D:\phpStudy\tmp\xdebug"
zend_extension="D:\phpStudy\php\php-5.6.27-nts\ext\php_xdebug.dll"
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.remote_enable=On //必须on,否则在调试时候会出错
xdebug.remote_host=localhost
xdebug.remote_port=9001 //nginx服务会占用9000端口
xdebug.remote_handler=dbgp
xdebug.idekey=netbeans-xdebug
之后重启服务,查看phpinfo(),查看xdebug是否正常加载。
4、配置netbeans,在工具-----选项中配置好参数(如图)
至此,断点调试可以正常使用。