【问题标题】:Warning in image_graphvizimage_graphviz 中的警告
【发布时间】:2010-03-24 06:29:08
【问题描述】:

我在 image_graphviz 中收到警告,我查看了 post,他有类似的错误。 我已经安装了 pear image_graphviz 包(Image_GraphViz-1.2.1),我还在 windows 中安装了 graphviz.msi(Graphviz2.25.msi)(但我不知道 image_graphviz 是否有什么作用,当我使用 image_graphviz 时它是否有一些影响)。

我需要做点别的吗?

这是我在 pear image_graphviz 网站上的代码。

<?php
require_once 'Image/GraphViz.php';
error_reporting(E_ALL ^ E_NOTICE);  //Added E_NOTICE
$gv = new Image_GraphViz();
$gv->addEdge(array('wake up'        => 'visit bathroom'));
$gv->addEdge(array('visit bathroom' => 'make coffee'));
$gv->image();
?> 

这是警告:

Warning: fopen(C:\WINDOWS\Temp\gra50.tmp.svg) [function.fopen]: failed to open stream: No such file or directory in C:\wamp\bin\php\php5.3.0\PEAR\Image\GraphViz.php on line 210

Notice: Undefined variable: data in C:\wamp\bin\php\php5.3.0\PEAR\Image\GraphViz.php on line 218

感谢 Pekka Gaiser,我使用了 error_reporting(E_ALL ^ E_NOTICE);。我不知道如何更改临时目录,但 c:/windows/temp 存在于我的计算机中。

我还没有解决问题。谢谢大家的建议。

【问题讨论】:

    标签: php graphviz


    【解决方案1】:

    [已编辑] 您确定您的 Graphviz pear 包实际上可以调用您安装的二进制文件吗?该软件包是否有任何设置,也许(可能)您必须在那里指定路径?

    如果二进制文件确实存在:c:\windows\temp 目录是否存在?您可以更改 Graphviz 中某处的临时目录吗?你真的在 Windows 上吗? php.ini中临时设置的位置可以改一下吗?

    要解决该通知,请尝试将 error_reporting 设置为

    error_reporting(E_ALL ^ E_NOTICE)
    

    关于未定义变量的注意事项在开发时提供了重要指导,但如果它们出现在生产包中,消除它们的唯一方法是关闭它们。

    【讨论】:

    • 感谢 Pekka Gaiser,我检查了 Image/Graphviz.php 文件,它没有指示任何有关 temp 的目录。 c:/windows/temp 确实存在,我不知道如何更改它。我认为这是 Windows 系统的默认设置,而不是 graphviz 的默认设置。我也没有在 php.ini 中找到设置。但由于您的建议,我使用 E_NOTICE。通知行消失。但我仍然有警告。谢谢。
    • 那你需要检查Graphviz PEAR包是否知道你安装的Graphviz Program。很可能有一个设置文件,您可以在其中设置路径。但是我不确定这一点,因为我既不知道 PEAR 也不知道 Graphviz。
    猜你喜欢
    • 2023-03-07
    • 2021-06-20
    • 2012-05-12
    • 2020-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-31
    • 1970-01-01
    相关资源
    最近更新 更多