Xhprof graphviz Warning: proc_open() [function.proc-open]: CreateProcess failed, error code 解决方法
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 解决方法的更多相关文章
- PHP错误Warning: Cannot modify header information - headers already sent by解决方法
这篇文章主要介绍了PHP错误Warning: Cannot modify header information - headers already sent by解决方法,需要的朋友可以参考下 今天在 ...
- PHP出现Warning: A non-numeric value encountered问题的原因及解决方法
本文介绍php出现Warning: A non-numeric value encountered问题,用实例分析出现这种错误的原因,并提供避免及解决问题的方法. <?php error_rep ...
- Vue+DataTables warning:table id=xxxx -Cannot reinitialize DataTable.报错解决方法
问题描述: 使用DataTables来写列表,用vue来渲染数据,有搜索功能,每次点击搜索就会报错,如下图所示. 问题排查: 找了一系列原因,最后发现是我每次请求完数据之后都会添加分页功能,从而导致了 ...
- php 出现Warning: A non-numeric value encountered问题的原因及解决方法
在使用(+ - * / ** % << >> | & ^) 运算时,例如a+b,如果a是开始一个数字值,但包含非数字字符(123a),b不是数字值开始时(b456),就 ...
- PHP - xhprof+Graphviz 安装配置
简介:XHProf是Facebook放出的轻量级调试工具.和Xdebug相比,XHProf更加易用和可控,尤其是生成流程图和调试数据对比的功能很好很强大. 参考:http://us2.php.net/ ...
- 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 ...
- IAR for msp430 MDK中 warning: #223-D: function "xxx" declared implicitly 解决方法
今天在EINT的范例里添加了一个函数,即eint.c中添加了一个datawrite()的函数,并在主函数main.c中调用,编译便警告 warning: #223-D: function " ...
- Warning: session_start() [function.session-start]: Cannot send session cookie解决办法
在很多时间使用了session就会出来如下提示了, Warning: session_start() [function.session-start]: Cannot send session coo ...
- 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 ...
随机推荐
- dubbo 源码学习1 服务发布机制
1.源码版本:2.6.1 源码demo中采用的是xml式的发布方式,在dubbo的 DubboNamespaceHandler 中定义了Spring Framework 的扩展标签,即 <dub ...
- 【备忘】EntityFramework 6 升级到 EntityFrameworkCore 注意点
正在将一个 .net framework 4.5 的项目升级到 .net core 2.1,其中使用到了 EF6,经历了一些修改: 命名空间的变化基本上可以靠自动提示补充完整,不需要强记. DbQue ...
- Android 流媒体技术见解
一.技术关键点 1. 音频采集:设置合理的采样参数,包括采样率.通道数.采样深度. 2. 视频采集:手机摄像头采集输出的格式(NV12/NV21/YV12),要注意相互间的转换,以及采集出来图像的方向 ...
- 数据结构(二): 轻量级键值对 SparseArray
SparseArray是Android framework中提供的轻量级的键值对数据结构,我们知道空间和效率从来都是相悖的,SparseArray的实现正是以时间来换取空间效率,适合小规模数据的存储. ...
- JDK设计模式之——策略模式(Comparable和Comparator接口)
策略模式:其实就是java的多态...父类引用指向子类对象. 使用策略模式,改善排序算法上文中需要排序的是一个数组 让他可以对任何类型的数组进行排序 1.利用 接口 Comparable<T&g ...
- Mybatis框架四:输入参数、输出参数
输入参数可以有三种:简单类型,POJO,包装类 关于前两种: http://www.cnblogs.com/xuyiqing/p/8600888.html 这里写一下传递包装类参数: 一个POJO:U ...
- 【Spark调优】大表join大表,少数key导致数据倾斜解决方案
[使用场景] 两个RDD进行join的时候,如果数据量都比较大,那么此时可以sample看下两个RDD中的key分布情况.如果出现数据倾斜,是因为其中某一个RDD中的少数几个key的数据量过大,而另一 ...
- db2 报错 sqlcode=-420 自动类型转换的问题
今天在测试遇到一个问题,前台点击页面查询数据时报错: , SQLSTATE, SQLERRMC=DECFLOAT, DRIVER=4.18.60 根据sqlcode查询错误原因为:-420 22018 ...
- Mac OS Eclipse 调试快捷键不好使(失效)的情况
Eclipse调试使用的F5 F6 F8一直都好用,结果一次调试后忽然不好使. 问题原因,尚未知晓. 解决办法,重启机器.
- express脚手架的安装,以及ejs的语法
express 1.建一个项目 npm init -y 初始化一下项目 2.cnpm install express -S 安装express模块 3.cnpm init 安装依赖 !ejs模板是后 ...