错误 - 无法找到 GraphViz 包的“dot”命令

错误 - 无法找到 GraphViz 包的“dot”命令

Ubuntu 精确(12.04.1 LTS)

我对 PEAR 还很陌生。

我安装了 PEAR。然后,使用 pear 安装了 phpdoc。

除了图形功能之外,它似乎运行得很好。

我运行了这个命令:

/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
$

我意识到在这个站点的 apache 虚拟主机中我有以下一行:

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

所以我想也许这阻止了其他目录的包含......?

所以我尝试将这一行改成这样:

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

那也没用,所以我最后注释掉这一行,但仍然出现同样的错误。

如果这有帮助的话,在里面/usr/share,我运行了这个命令:

/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$

我不明白为什么这不起作用。谢谢你的帮助。

答案1

我在生成 PHPDoc 时遇到了这个问题,在“将分析的项目转换为工件”阶段。我通过执行以下命令解决了这个问题

sudo apt-get install graphviz

答案2

我尝试使用 PEAR 安装它。

sudo pear install Image_GraphViz

我最终只是升级了(实际上)所有内容,并且成功了。

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

不确定究竟是什么起了作用,但现在有效了。

答案3

对于非 apt-get 用户。

brew install graphviz

帮我整理好了,PHPDoc 也需要它。

答案4

我遇到了同样的问题。您需要确保已安装“dot”。

“dot” 包含在 GraphViz 中。

相关内容