View Issue Details

IDProjectCategoryView StatusLast Update
0005037mantisbtrelationshipspublic2020-11-26 02:38
Reportermasc Assigned Tograngeway  
Status closedResolutionfixed 
PlatformX86OSWindowsOS VersionWin2K
Product Version0.19.2 
Target Version1.3.0-beta.1Fixed in Version1.3.0-beta.1 
Summary0005037: No more rel. graphs with PHP 4.3.10 and Win2K

Using PHP 4.3.10 (same config ini used in 4.3.9), all the relationship graphs are no more working. The problem seems to be in the graph library.
Are the graphs still well working on Linux?

TagsNo tags attached.


related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 
has duplicate 0006620 closedgrangeway Relationgraph is not displayed 
has duplicate 0006178 closedgrangeway relationship graph is empty 
has duplicate 0008694 closedgrangeway Relationship/Dependency graphs fail 
related to 0027584 resolveddregad Out of the box Mantis does not display either a Dependancy or Relationship Graph 




2004-12-22 17:46

reporter   ~0008768

I'll start labeling issues as YAGVBUW (Yet Another GraphViz Bug Under Windows)... It is just fine under linux, with Apache 2.0.51, PHP 4.3.10, MySQL 3.23.58 and GraphViz 2.0.

Can't you get some more information? What happens? Just a blank page?



2004-12-22 18:38

reporter   ~0008771

Same issue with me. PHP 4.3.6 and Win2K and no errors only a blank page appears. Can't find any debugging info anywhere on GraphViz.



2004-12-23 01:31

reporter   ~0008776

The problem seems located in graphwiz_api.php->output() in:
$t_graphviz = new COM( $this->graphviz_com_module );

It returns null and then no images at all.



2004-12-23 06:06

reporter   ~0008778

Try reinstalling wingraphviz, so the COM object gets re-registered. If this is not the problem, then it looks like the COM interface got broken somehow on 4.3.10.



2004-12-23 14:20

reporter   ~0008790

I tried to re-install WinGraphViz, but nothing happened.



2004-12-23 14:39

reporter   ~0008791
Check there, you'll have a surprise.



2004-12-23 14:44

reporter   ~0008792

Err... WTF... Mantis broke the url on `?´... just join the two pieces, or open and go directly to bug 30906.

BTW, we should put a warning on config_defaults_inc.php and core/relationship_graphs_inc.php and set this issue as wont fix. There isn't anything to do but to blame PHP developers.



2005-02-27 11:33

reporter   ~0009392

I was able to get the Relationship Graphs working with the Win32 command line version of Graphviz 2.00 under Windows 2003, IIS 6.0, PHP 4.3.10, Mantis 0.19.2.

  • Downloaded Win32 Graphviz from

    • Installed to my web support applications directory: D:\Apps\bin\Graphviz-2.00
  • Patched .\core\graphviz_api.php (v 1.4 2004/11/07)

    • See attached diff file graphviz_api_php_cmdline_util.diff
    • The patch is a bit of a quick hack but I didn't want to disturb the non-Windows code as much as possible as I have no facility to confirm its behaviour.
    • Basically, I had two issues:
    • First, the TMPDIR environment variable isn't befined by default on Windows so I used TMP instead.
    • Second, I couldn't get the passthru to capture the output correctly (unable to determine if this is a PHP/Graphviz issue) so I called via system, creating a second temp file, whose contents were passed back to the browser.
  • Configured appropriately in config_inc.php
    $g_dot_tool = 'D:\Apps\bin\Graphviz-2.00\bin\dot.exe';
    $g_neato_tool = 'D:\Apps\bin\Graphviz-2.00\bin\neato.exe';

  • Permissions note: the IUSR_<servername> account needs modification rights on the temporary directory.

2005-02-27 11:34


graphviz_api_php_cmdline_util.diff (1,792 bytes)   
<                       if ( 'WIN' == substr( PHP_OS, 0, 3 ) ) {
>                       # if ( 'WIN' == substr( PHP_OS, 0, 3 ) ) {
>                       if ( 0 ) {
<                       } else if ( php_version_at_least( '4.3.0' ) ) {
>                       # } else if ( php_version_at_least( '4.3.0' ) ) {
>                       } else if ( 0 ) {
<                               if ( isset( $_ENV['TMPDIR'] ) )
<                                       $t_tmpdir = $_ENV['TMPDIR'];
>                               # if ( isset( $_ENV['TMPDIR'] ) )
>                               #       $t_tmpdir = $_ENV['TMPDIR'];
>                               if ( isset( $_ENV['TMP'] ) )
>                                       $t_tmpdir = $_ENV['TMP'];
>                               $t_bitmap = $t_filename . '.' . $p_format;
>                               register_shutdown_function( 'unlink', $t_bitmap );
>                                                        ' -o' . $t_bitmap . ' ' .
<                                       passthru( $t_command );
>                                       header( 'X-Command: ' . $t_command );
>                                       header( 'X-TempFile: ' . $t_filename );
>                                       # passthru( $t_command );
>                                       system( $t_command );
>                                       echo file_get_contents( $t_bitmap );
<                                       passthru( $t_command );
>                                       # passthru( $t_command );
>                                       system( $t_command );
>                                       echo file_get_contents( $t_bitmap );



2005-02-27 18:56

reporter   ~0009393

WinGraphviz news
headlines below...
You can get it by SVN
hmm..., this might be useful for debugging why the COM support was 'unstable'



2005-02-27 18:57

reporter   ~0009394

leighton: php/webserver user needs access to cmd.exe to run that though?



2005-02-27 22:57

reporter   ~0009395


The graphviz system was originally designed this way, until I found that passthru, proc_open and system use cmd.exe instead of spawning dot.exe/neato.exe directly. This leads to a security risk, and then we chose to use WinGraphviz.

Some of your changes were basically a revert of what was done originally on 0004434. But why did you use passthru? proc_open is preferred, since we can pipe the output to dot/neato and let them pipe the graph back to the webserver.



2005-02-28 09:44

reporter   ~0009401

Last edited: 2005-02-28 09:45

Yes, you need access to cmd.exe. I had another tool, cacti ( ) that had the cmd.exe dependency for php. Sorry that I had forgotten about that.

I didn't go down the proc_open route as it looked messier (not being much of a PHP person) and I was limited on time on Friday.

I agree the COM interface is MUCH preferrable, but the comments that I had seen indicated that there wasn't much development activity and that this was likely to remain buggy for some time. Somehow my searches missed bug 0004434 so I missed much of the history of this feature ;-)

I also saw a very similar fix made on Friday in the forums (after I posted my bug, of course) and discovered that there is a newer version of the Graphviz utilties for Windows.



2005-04-26 16:20

reporter   ~0009929

I've got a little closer to getting this one working. PHP 4.3.11 seems to have fixed the some of the COM() problems, but I can still only get the graphs to work if I make the IUSR account (used for annonymous access in IIS) a member of Administrators. Otherwise, PHP reports an access violation.

So I assume it's some file permission or security rights issue, but I can't figure out exactly what the problem is. IUSR has read+execute permissions to the WinGraphviz.dll itself, so I don't think that's the issue. Is there a right that must be granted to IUSR to allow it to instantiate COM objects? Does WinGraphviz create temp files anywhere?

PHP 4.3.11
Server 2003+IIS6
Mantis 0.19.2 and 1.0.0a2



2006-02-08 18:40

reporter   ~0012117

It's working for me. Here's my setup:

Client: Win2K, WinGraphviz 1.02.24 (msi), either IE6 or Firefox
Server: Mandriva 2006, PHP 5.0.4, Apache 2.0.54



2006-02-22 15:49

reporter   ~0012211

Last edited: 2006-02-23 05:04

I was able to make WinVizGraph partially work under my setup (W2K Server, Apache 2.0.55, PHP 5.1.2), using and looks to be buggy and generates only partial images or no images at all on my system.
I found out that WinVizGraph cannot generate CMAP, and that blocks the page generation. To make it work I had to comment out line:

relgraph_output_map( $t_graph, 'relationship_graph_map' );

in bug_relationship_graph.php, because $p_graph->output( 'cmap' ); returns what looks an empty string. It could be a workaround, although the graph become "static".



2006-08-23 08:38

reporter   ~0013317

Last edited: 2006-08-23 08:39

I've got a little closer to getting this one working. PHP 4.3.11 seems to have
fixed the some of the COM() problems, but I can still only get the graphs to
work if I make the IUSR account (used for annonymous access in IIS) a member
of Administrators. Otherwise, PHP reports an access violation.

I've just spent most of this morning dealing with the same problem. I've finally found a solution, so I'll post it here just in case it helps anyone having the problem in the future.

WinGraphViz on PHP6 seems to require write access to the root of the C drive (or presumably wherever you installed windows)

Just open the NTFS permissions for C, click Advanced, then for whatever group/user you want to be able to see relationship graphs just add a new permission for Create Files/Write Data pertaining only to the current directory (i.e. NOT subfolders and files).

I'm running:
IIS6 on Windows Server 2003
Mantis 1.0.5
WinGraphViz 1.02.24



2007-05-22 07:58

reporter   ~0014589

Why isn't this in the platform yet ?

I've just made this work by using posts that are several years old.

Don't use WinGraphviz it's to old, just use Graphviz for Windows and do the folowing:

  • Install Graphviz on the server
  • Patch mantis\core\graphviz_api.php to this if ( 'WIN' == substr( PHP_OS,
  • In config_inc.php enable the function and set paths

    $g_relationship_graph_enable = ON;
    $g_dot_tool = '"C:\Program Files\ATT\GraphViz\bin\dot.exe"';
    $g_neato_tool = '"C:\Program Files\ATT\GraphViz\bin\neato.exe"';

Please put this into 1.1.0.



2007-05-22 10:30

reporter   ~0014593

Since the patch attachment is missing, where is the specific code patch to mantis\core\graphviz_api.php to get Mantis working with Graphviz for Windows?



2007-05-23 01:20

reporter   ~0014600

Last edited: 2007-05-23 10:25

There is no 'specific code patch', it is just a question about disabling the current functionality when running on Windows. In graphviz_api.phi where this is done (aprox. line 280)

if ( 'WIN' == substr( PHP_OS, 0, 3 ) ) {

just change WIN to something else like WIN, and run like standard.

It works on Windows Xp, Apache, MySql, Php 5.xx



2010-08-14 14:37

reporter   ~0026314

Fixed by removing support for wingraphviz - just use the dot/neato exe's - see snapshot/commit @;h=629a6760104e5f742ad54b5a765be78d4c42eef3



2013-04-05 17:57

reporter   ~0036493

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master 629a6760

2010-08-14 18:17:46


Details Diff
Fix: 0005037
Fix: 0006620
Fix: 0006178
Fix: 0008694

Remove support for wingraphviz. If people don't want to allow IIS to access cmd.exe, it would probably
be more sensible to write a dotnet wrapper around graphviz (e.g.

However, that still needs a medium/full trust environment in I believe.

Windows users can install graphviz by downloading, the MSI from, allowing access to cmd.exe to the php application pool in IIS, and modifying the dot/neato paths.
Affected Issues
0005037, 0006178, 0006620, 0008694
mod - core/graphviz_api.php Diff File
mod - config_defaults_inc.php Diff File