vscode php7.3 xdebug 快速配置教程

2019-12-31  本文已影响0人  猪脚面线

碎碎念

在配置php和vscode时查阅了很多教程,走了点弯路,于是快速记录下,前人栽树,后人乘凉!

开始

<?php
$myfile = fopen("result.txt", "w") or die("Unable to open file!"); 
# 打开输出缓冲区  
# 所有的输出信息不直接发送到浏览器,而是保存在输出缓冲区  
ob_start();  
  phpinfo();  
  $txt = ob_get_contents();  
ob_end_clean();  
  
fwrite($myfile, $txt);  
fclose($myfile);
?>

之后打开运行脚本的当前目录下的result.txt,全选复制粘贴到分析页面输入框后,点击分析,形成分析结果,如下图,点击下载对应版本即可。


image.png
[xdebug]
zend_extension = "C:\xampp\php\ext\php_xdebug-2.9.0-7.3-vc15-x86_64.dll"
xdebug.remote_enable = On
;启用性能检测分析
xdebug.profiler_enable = On
;启用代码自动跟踪
xdebug.auto_trace=On
xdebug.profiler_enable_trigger = On
xdebug.profiler_output_name = cachegrind.out.%t.%p
;指定性能分析文件的存放目录
xdebug.profiler_output_dir ="G:/wamp64/tmp"
xdebug.show_local_vars=0

;配置端口和监听的域名
xdebug.remote_port=9000
xdebug.remote_host="localhost"
上一篇 下一篇

猜你喜欢

热点阅读