【问题标题】:Simple question about image_graphviz关于 image_graphviz 的简单问题
【发布时间】:2023-03-07 17:32:01
【问题描述】:

我正在尝试显示 image_graphviz Here 的示例,但它没有在我的页面中显示任何内容。

这是我的页面:

test.php

       <?php
        require_once 'Image/GraphViz.php';

        $gv = new Image_GraphViz();
        $gv->addEdge(array('wake up'        => 'visit bathroom'));
        $gv->addEdge(array('visit bathroom' => 'make coffee'));
        $gv->image(); 

?>

我认为路径有问题,然后我使用绝对路径“C:/wamp/bin/php/php5.3.0/PEAR/Image/GraphViz.php”。但它也不起作用。

有什么问题吗?你有什么主意吗?

非常感谢。

【问题讨论】:

    标签: php graphviz


    【解决方案1】:

    您应该尝试将 error_reporting 转为 E_ALL

    error_reporting(E_ALL);
    

    我很确定 PHP 遇到错误但没有输出。同样作为一个好的策略,建议您在开发时始终打开 E_ALL 错误报告级别。

    查看文档there,它似乎传递了图像数据,因此请确保您的 PHP 文件开头没有任何空间,如果您这样做,header 函数将不起作用。

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

    【讨论】:

    • 感谢@Ragez,我尝试了error_reporting,没有错误。我想我已经安装了 pear image_graphviz,我已经在 cmd 中对其进行了测试。但实际上它不适用于 php。我不知道为什么。
    • 您可能想编辑GraphViz.php 并通过在文件中添加一些调试内容来查看那里发生了什么。
    • @RageZ,感谢您的建议。我试了又试,没有错误,什么也没有显示。我很困惑。
    【解决方案2】:

    您应该安装 GraphVIZ,请查看以下链接,希望对您有所帮助 http://www.graphviz.org/Download..php

    【讨论】:

      猜你喜欢
      • 2011-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-22
      • 2011-08-19
      • 2010-10-28
      • 1970-01-01
      相关资源
      最近更新 更多