Question

I'm trying to display the example of image_graphviz Here, but it doesn't display anything in my page.

Here is my page:

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(); 

?>

I think there is something wrong with the path, and then i use the absolute path which is "C:/wamp/bin/php/php5.3.0/PEAR/Image/GraphViz.php". But it doesn't work too.

Is there something wrong? Do you have any idea?

Thanks a lot.

Was it helpful?

Solution

your should try turn the error_reporting to E_ALL

i.e.

error_reporting(E_ALL);

I am pretty sure PHP encounter an error but not output it. Also as a good policy it's advice to always turn on E_ALL the error reporting level when you develop.

looking at the doc there it seems to pass the image data so make sure your don't have any space at the start of your PHP file, if you do header function won't work.

*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(); 

?>

OTHER TIPS

you should install the GraphVIZ , check the following link i hope it is helpful for you http://www.graphviz.org/Download..php

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top