graphviz-php - segmentation fault

I am on RHE 6 and I have installed the following rpms with yum:
graphviz-2.34.0-1.el6.x86_64.rpm
graphviz-php-2.34.0-1.el6.x86_64.rpm

The example (/usr/share/graphviz/demo/modgraph.php) runs successfully on the command prompt.

I am trying to write a simple php page to display a graph (My webserver is Apache 2.2.15).

I use the following code:
<?php
include("gv.php");

$g = gv::digraph('my first graph');
$node1 = gv::node($g, 'node1');
$node2 = gv::node($g, 'node2');
$edge = gv::edge($node1, $node2);
$edge = gv::edge($node1, $node1);
$edge = gv::edge($node2, $node2);
$e = gv::edge($node1, '11');
$e = gv::edge('22', $node2);
$e = gv::edge($g, 'x', 'y');
$e = gv::edge($g, 'x', 'y');

$f = fopen('output.log', 'w') or die("can't open file");
fwrite($f, (string)time() . "\n");

fwrite($f, "layout\n");
$r = gv::layout($g, 'dot') or die('layout error');
fwrite($f, "$r\n");

fwrite($f, "render\n");
header('Content-Type: image/png');
$r = gv::render($g, 'png'/*, 'graph.png'*/) or die('render error');
fwrite($f, "$r\n");

fwrite($f, "remove\n");
$r = gv::rm($g);
fwrite($f, "$r\n");

fclose($f);
?>

When I browse to the page (using Chrome), it says: "no data received", and the output.log looks like this:
1387404734
layout

And I see the following in Apache logs:
[Wed Dec 18 14:42:56 2013] [notice] child pid 12198 exit signal Segmentation fault (11)

I tried to use earlier rpms (2.26.0-10.el6), the page then doesn't display anything, I do not get errors in the Apache logs and the output.log looks much better:
1387404734
layout
1
render
1
remove
1

But the browser still doesn't display anything and I get a cryptic error (at least, for me):
Error in event handler for (unknown): TypeError: Cannot read property 'className' of null
at chrome-extension://kcnhkahnjcbndmmehfkdnkjomaanaooo/contentscript.js:111:162
at extensions::messaging:327:9
at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14)
at Event.dispatchToListener (extensions::event_bindings:386:22)
at Event.dispatch_ (extensions::event_bindings:371:27)
at Event.dispatch (extensions::event_bindings:392:17)
at dispatchOnMessage (extensions::messaging:294:22)

Did I miss something? Is graphviz-php still supported at this point? Any piece of php script I could try?

Thanks.

The submitter responded

The submitter responded off-line that the problem was in selinux.

Recent comments