Ubuntu

錯誤 - 無法找到 GraphViz 包的“點”命令

  • May 28, 2020

Ubuntu 精確(12.04.1 LTS)

我對 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$

我不明白為什麼這不起作用。謝謝你的幫助。

我嘗試使用 PEAR 安裝它。

sudo pear install Image_GraphViz

我最終只是升級(實際上)EVERYTING 並且它起作用了。

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

不知道究竟是什麼伎倆,但它現在有效。

在“將分析的項目轉換為工件”階段生成 PHPDoc 時,我遇到了這個問題。我通過執行以下命令解決了這個問題

sudo apt-get install graphviz

引用自:https://serverfault.com/questions/575239