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 ...
随机推荐
- MFC中的一些视图
本章主要介绍MFC中主要的视图类,这些继承自Cview类. 继承关系如上图所示. 滚动视图 CscrollView给Cview添加了基本的滚动功能,它包含WM_VSCROLL和WM_HSCROLL消息 ...
- [转] OpenStack — nova image-create, under the hood
I was trying to understand what kind of image nova image-create creates. It's not entirely obvious f ...
- VSCode插件开发全攻略(六)开发调试技巧
更多文章请戳VSCode插件开发全攻略系列目录导航. 前言 在介绍完一些比较简单的内容点之后,我觉得有必要先和大家介绍一些开发中遇到的一些细节问题以及技巧,特别是后面一章节将要介绍WebView的知识 ...
- 在MFC中支持sqlite3
在vc环境下支持sqlite3的方法有很多,sqlite官网也有推荐sqlitewrappers列表,我选用的是CppSqlite 建立MFC工程的步骤我就不赘述了,以下操作均假设你已经创建好了一个M ...
- 【DocFX文档翻译】DocFX 入门 (Getting Started with DocFX)
DocFX 入门 1. DocFX 是什么? DocFX 是一个基于.NET的API文档生成器,当前支持 C# 和 VB. 它可以通过你的代码中的三斜杠注释生成 API 参考文档.同样也支持你使用 M ...
- 从Java到JVM到OS线程睡眠
Java 中有时需要将线程进入睡眠状态,这时一般我们就会通过 Thread.sleep 使线程进入睡眠状态,接下去就看看执行该语句在 JVM 中做了什么. 简单例子 以下是一个简单的例子,使主线程睡眠 ...
- Android UID 机制
UID一般理解为User Identifier,在linux中就是用户的ID,表明是哪个用户运行了这个程序.它们主要用于权限的管理. 而在Android 中又有所不同,因为Android为单用户系统, ...
- Axure安装、破解、汉化全套
最近公司准备使用敏捷开发流程,然后刚好需要Axure这个软件,就去找了些资源分享给大家,希望对大家有所帮助: 全套安装,破解,汉化下载地址: 链接: https://pan.baidu.com/s/1 ...
- Linux编程 24 shell编程(结构化 if [ condition ] 数值比较,字符串比较)
一.概述 接着上篇讲的结构化命令,最后讲到了test命令的另一种写法 if [ condition ],它的语法格式如下: --格式如下: if [ condition ] then commands ...
- 模板发送java邮件
Creating email content using a templating library The code in the previous examples explicitly creat ...