Xhprof在windows下点击[View Full Callgraph]调用graphviz软件时。
警告Warning: proc_open() [function.proc-open]: CreateProcess failed, error code – 0 in
并提示
failed to execute cmd " D:/graphviz-2.38/release/bin/dot -Tpng"

位置是xhprof_lib/utils/callgraph_utils.php文件下xhprof_generate_image_by_dot函数
windows下
$cmd = " dot -T".$type;
需要替换成
$cmd = " D:/graphviz-2.38/release/bin/dot -T".$type;

问题就出现在这行代码
$process = proc_open($cmd, $descriptorspec, $pipes, "/tmp", array());
需要改成
$process = proc_open($cmd, $descriptorspec, $pipes);

或者是建立相应的tmp文件夹,因为默认是不存在tmp文件夹的。尝试在网站根目录建立tmp文件夹但是还是保存,于是改成了在当前目录。
$process = proc_open($cmd, $descriptorspec, $pipes, "tmp", array());

//修改后的正确代码

function xhprof_generate_image_by_dot($dot_script, $type) {
//echo($dot_script);
$descriptorspec = array(
// stdin is a pipe that the child will read from
0 => array("pipe", "r"),
// stdout is a pipe that the child will write to
1 => array("pipe", "w"),
// stderr is a pipe that the child will write to
2 => array("pipe", "w")
); //$cmd = " dot -T".$type; //linux下
//1.修改graphviz目录
$cmd = " D:/graphviz-2.38/release/bin/dot -T".$type;//windows下
//2.tmp文件夹处理
$process = proc_open($cmd, $descriptorspec, $pipes);
if (is_resource($process)) {
fwrite($pipes[0], $dot_script);
fclose($pipes[0]); $output = stream_get_contents($pipes[1]); $err = stream_get_contents($pipes[2]);
if (!empty($err)) {
print "failed to execute cmd: \"$cmd\". stderr: `$err'\n";
exit;
} fclose($pipes[2]);
fclose($pipes[1]);
proc_close($process);
return $output;
}
print "failed to execute cmd \"$cmd\"";
exit();

  

}

Xhprof graphviz Warning: proc_open() [function.proc-open]: CreateProcess failed, error code 解决方法的更多相关文章

  1. PHP错误Warning: Cannot modify header information - headers already sent by解决方法

    这篇文章主要介绍了PHP错误Warning: Cannot modify header information - headers already sent by解决方法,需要的朋友可以参考下 今天在 ...

  2. PHP出现Warning: A non-numeric value encountered问题的原因及解决方法

    本文介绍php出现Warning: A non-numeric value encountered问题,用实例分析出现这种错误的原因,并提供避免及解决问题的方法. <?php error_rep ...

  3. Vue+DataTables warning:table id=xxxx -Cannot reinitialize DataTable.报错解决方法

    问题描述: 使用DataTables来写列表,用vue来渲染数据,有搜索功能,每次点击搜索就会报错,如下图所示. 问题排查: 找了一系列原因,最后发现是我每次请求完数据之后都会添加分页功能,从而导致了 ...

  4. php 出现Warning: A non-numeric value encountered问题的原因及解决方法

    在使用(+ - * / ** % << >> | & ^) 运算时,例如a+b,如果a是开始一个数字值,但包含非数字字符(123a),b不是数字值开始时(b456),就 ...

  5. PHP - xhprof+Graphviz 安装配置

    简介:XHProf是Facebook放出的轻量级调试工具.和Xdebug相比,XHProf更加易用和可控,尤其是生成流程图和调试数据对比的功能很好很强大. 参考:http://us2.php.net/ ...

  6. PHP Warning: date() [function.date]: It is not safe to rely on the system's timezone

    在用PHP5.3以上的PHP版本时,只要是涉及时间的会报一个 Warning: phpinfo() [function.phpinfo]: It is not safe to rely on the ...

  7. IAR for msp430 MDK中 warning: #223-D: function "xxx" declared implicitly 解决方法

    今天在EINT的范例里添加了一个函数,即eint.c中添加了一个datawrite()的函数,并在主函数main.c中调用,编译便警告 warning: #223-D: function " ...

  8. Warning: session_start() [function.session-start]: Cannot send session cookie解决办法

    在很多时间使用了session就会出来如下提示了, Warning: session_start() [function.session-start]: Cannot send session coo ...

  9. Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by

    配置php网站的时候,经常会在页首出现Warning: session_start() [function.session-start]: Cannot send session cache limi ...

随机推荐

  1. cvpr2018(转发一篇头条)

    CVPR 2018:腾讯图像去模糊.自动人像操纵最新研究 新智元 2018-05-29 14:13:04 新智元报道 来源:腾讯优图 编辑:江磊.克雷格 [新智元导读]即将在6月美国盐湖城举行的计算机 ...

  2. day19_雷神_django第二天

    django_day02 Django的路由系统 URL配置(URLconf)就像Django所支撑网站的目录.它的本质是URL与要为该URL调用的视图函数之间的映射表. 1.URLconf配置 基本 ...

  3. Openvswitch手册(3): sFlow, netFlow

    这一节,我们重点看sFlow 采样流sFlow(Sampled Flow)是一种基于报文采样的网络流量监控技术,主要用于对网络流量进行统计分析. sFlow系统包含一个嵌入在设备中的sFlow Age ...

  4. Javascript高级编程学习笔记(28)—— BOM(2)window对象2

    今天讲一下window对象和浏览器导航,弹窗等有关的内容 导航和打开窗口 window.open() 用于导航到某个特定 url 该方法接收四个参数 1.url 2.窗口目标(当页面中有多个框架fra ...

  5. (爬虫向)python_json学习笔记

    JSON学习笔记 - 在线工具 - https://www.sojson.com/ - http://www.w3school.com.cn/json/ - http://www.runoob.com ...

  6. Alibaba FastJson 常用方法使用指南

    介绍 FastJson是阿里巴巴的开源JSON解析库,它可以解析JSON格式的字符串,支持将Java Bean序列化为JSON字符串,也可以从JSON字符串反序列化到JavaBean. FastJso ...

  7. C 单向链表就地逆转

    1.问题描述 给定一个单链表L,设计函数Reverse将L就地逆转.即不需要申请新的节点,将第一个节点转换为最后一个结点,第二个节点转换为倒数第二个结点,以此类推. 2.思路分析 循环处理整个链表.将 ...

  8. Testing - 自动化测试的几个基础概念

    自动化测试框架与模型 一个自动化测试框架就是一个集成体系,在这一体系中包含测试功能的函数库.测试数据源.测试对象识别标准,以及种可重用的模块. 自动化测试框架在发展的过程中经历了几个阶段,模块驱动测试 ...

  9. [原创]K8 Jboss jmx-console getshell exploit

    [原创]K8 Jboss jmx-console getshell exploit https://www.cnblogs.com/k8gege/p/10645858.html 0x00 前言 今天内 ...

  10. odoo开发笔记 -- tree视图按指定字段group_by分组显示

    注意点: view视图文件中的搜索视图要放在action视图的前边. 在action视图中,要写search_view_id, 还有context, search_default_group_by_字 ...