Saturday, January 29, 2011

Image_GraphViz Not Compatible With PHP 5.3.x

I have a problem with Image_GraphViz PEAR package. I installed it on my computer and i tried the example, but it doesn't work on PHP 5.3.5. Instead, i got this following error messages:

Strict Standards: Non-static method System::mktemp() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Image/GraphViz.php on line 1005

Strict Standards: Non-static method System::_parseArgs() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 385

Strict Standards: Non-static method Console_Getopt::getopt2() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 76

Strict Standards: Non-static method Console_Getopt::doGetopt() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Console/Getopt.php on line 75

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Console/Getopt.php on line 109

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 386

Strict Standards: Non-static method System::tmpdir() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 400

Strict Standards: Non-static method System::mkDir() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 403

Strict Standards: Non-static method System::_parseArgs() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 239

Strict Standards: Non-static method Console_Getopt::getopt2() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 76

Strict Standards: Non-static method Console_Getopt::doGetopt() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Console/Getopt.php on line 75

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Console/Getopt.php on line 109

Strict Standards: Non-static method Console_Getopt::_parseShortOption() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Console/Getopt.php on line 162

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Console/Getopt.php on line 167

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 240

Strict Standards: Non-static method PEAR::registerShutdownFunc() should not be called statically, assuming $this from incompatible context in /usr/share/pear/System.php on line 421

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/pear/Image/GraphViz.php on line 204

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method System::_removeTmpFiles() should not be called statically in /usr/share/pear/PEAR.php on line 774

Strict Standards: Non-static method System::rm() should not be called statically in /usr/share/pear/System.php on line 440

Strict Standards: Non-static method System::_parseArgs() should not be called statically in /usr/share/pear/System.php on line 193

Strict Standards: Non-static method Console_Getopt::getopt2() should not be called statically in /usr/share/pear/System.php on line 76

Strict Standards: Non-static method Console_Getopt::doGetopt() should not be called statically in /usr/share/pear/Console/Getopt.php on line 75

Strict Standards: Non-static method PEAR::isError() should not be called statically in /usr/share/pear/Console/Getopt.php on line 109

Strict Standards: Non-static method Console_Getopt::_parseShortOption() should not be called statically in /usr/share/pear/Console/Getopt.php on line 166

Strict Standards: Non-static method PEAR::isError() should not be called statically in /usr/share/pear/Console/Getopt.php on line 167

Strict Standards: Non-static method PEAR::isError() should not be called statically in /usr/share/pear/System.php on line 194

Strict Standards: Non-static method System::_multipleToStruct() should not be called statically in /usr/share/pear/System.php on line 204

The example source code is very simple. Here they are:

<?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 tried to debug this code and i found out that the last line that caused the problem to appear which i think it's related to strictness of PHP 5.3.x compared to earlier version of PHP. I am thinking about compatibility issues between Image_GraphViz and PHP 5.3.x. I hope it can be solved as soon as possible

6 comments:

  1. Hi Willy, where you able to resolve the problem with Image_GraphViz ?

    Thank you.
    jnc

    ReplyDelete
  2. No, they marked it as Won't Fix :(

    ReplyDelete
  3. What do you mean by that? I installed the entire Image graphviz and also the AT&T desktop app, got rid of all the php errors and finally I don't see any rendering.
    Just a blank page.

    So you are saying Image graphviz will not work for PHP 5.3.x then?!

    Anyone tried to solve this?
    thanks,

    Jose

    ReplyDelete
  4. i haven't tried it again, but i think it's not working yet

    ReplyDelete
  5. Hello Slackware User =D!

    To solve that you have to change the config to do not show errors in the file php.ini . You must set all the vars about errors to "production" or off.

    I hope that helps =D
    See you

    A Gentoo's User xD.

    ReplyDelete