20

Ubuntu precise (12.04.1 LTS)

I'm rather new to PEAR.

I installed PEAR. Then, using pear I installed phpdoc.

It seems to be working great except for the graphing functions.

I ran this command:

/var/www/site5 $ phpdoc -f models/classes.php -t ./docs/classes

Collecting files .. OK
Initializing parser .. OK
Parsing files
Parsing /var/www/site5/models/classes.php
Storing cache in "/var/www/site5/docs/classes" .. OK
Load cache                                                         ..    0.026s
Preparing template "clean"                                         ..    0.069s
Preparing 15 transformations                                       ..    0.000s
Build "elements" index                                             ..    0.017s
Replace textual FQCNs with object aliases                          ..    0.151s
Build "packages" index                                             ..    0.015s
Collect all markers embedded in tags                               ..    0.015s
Build "namespaces" index and add namespaces to "elements"          ..    0.004s
Transform analyzed project into artifacts                          .. Unable to
find the `dot` command of the GraphViz package. Is GraphViz correctly installed
and present in your path?  12.465s
Analyze results and write report to log                            ..    0.004s
$

I realized that in my apache virtual host for this site I had this line:

    php_value include_path ".:/var/www/site5/includes"

And so I thought maybe that was preventing inclusion of other directories... ?

So I tried changing the line to this:

    php_value include_path ".:/var/www/site5/includes:/usr/lib/php:/usr/share/php"

That didn't work either, so I finally commented out the line, but still the same error.

In case this helps, inside of /usr/share, I ran this command:

/usr/share$ find -name "*GraphViz*"
./php/phpDocumentor/vendor/phpdocumentor/graphviz/src/phpDocumentor/GraphViz
./php/phpDocumentor/vendor/phpdocumentor/graphviz/tests/phpDocumentor/GraphViz
./php/Image/GraphViz.php
./php/test/Image_GraphViz
./php/data/phpDocumentor/features/generate-documentation/graphs/GenerateClassDia
gramUsingGraphViz.feature
/usr/share$

I don't see why this is not working. Thanks for your help.

Buttle Butkus
  • 1,719
  • 8
  • 32
  • 45

4 Answers4

46

I had this problem when generating PHPDoc, during the "Transform analyzed project into artifacts"-phase. I solved this problem by executing the following command

sudo apt-get install graphviz
niekoost
  • 561
  • 4
  • 4
3

I tried installing it using PEAR.

sudo pear install Image_GraphViz

I ended up just upgrading (practically) EVERYTING and it worked.

apt-get --fix-missing
sudo apt-get install php-pear --fix-missing
sudo apt-get install php-pear
sudo apt-get install php5-xsl
sudo apt-get update

Not sure what exactly did the trick, but it works now.

Buttle Butkus
  • 1,719
  • 8
  • 32
  • 45
2

I had the same issue. You'll need to make sure you have "dot" installed.

"dot" is included with GraphViz.

Dennis Nolte
  • 2,848
  • 4
  • 26
  • 36
Anthony
  • 111
  • 2
  • 15
2

For the non-apt-getters.

brew install graphviz

sorted it out for me, also needed it for PHPDoc.

Atari
  • 21
  • 2