我在这里找到了一些相关的问题,但它们似乎都是通过安装一个缺失的graphiz来解决的。在我的情况下,它肯定是安装在路径中。
PHPDoc的错误是:
Execute transformation using writer "Graph"
PHP Warning: exec(): Unable to fork [dot -V 2>&1] in /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Graphs/Writer/Graph. php on line 254
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpdoc:0
PHP 2. phpDocumentor\Application->run() /usr/bin/phpdoc:24
PHP 3. Symfony\Component\Console\Application->run() /usr/share/php/phpDocumentor/src/phpDocumentor/Application.php:183
PHP 4. Symfony\Component\Console\Application->doRun() /usr/share/php/phpDocumentor/vendor/symfony/console/Symfony/Component/Console/Application.php:126
PHP 5. Symfony\Component\Console\Application->doRunCommand() /usr/share/php/phpDocumentor/vendor/symfony/console/Symfony/Component/Console/Application.php:195
PHP 6. Symfony\Component\Console\Command\Command->run() /usr/share/php/phpDocumentor/vendor/symfony/console/Symfony/Component/Console/Application.php:874
PHP 7. phpDocumentor\Command\Project\RunCommand->execute() /usr/share/php/phpDocumentor/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:253
PHP 8. Symfony\Component\Console\Command\Command->run() /usr/share/php/phpDocumentor/src/phpDocumentor/Command/Project/RunCommand.php:275
PHP 9. phpDocumentor\Transformer\Command\Project\TransformCommand->execute() /usr/share/php/phpDocumentor/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:253
PHP 10. phpDocumentor\Console\Output\Output->writeTimedLog() /usr/share/php/phpDocumentor/src/phpDocumentor/Transformer/Command/Project/TransformCommand.php:206
PHP 11. call_user_func_array:{/usr/share/php/phpDocumentor/src/phpDocumentor/Console/Output/Output.php:59}() /usr/share/php/phpDocumentor/src/phpDocumentor/Console/Output/Output.php:59
PHP 12. phpDocumentor\Transformer\Transformer->execute() /usr/share/php/phpDocumentor/src/phpDocumentor/Console/Output/Output.php:59
PHP 13. phpDocumentor\Transformer\Transformer->transformProject() /usr/share/php/phpDocumentor/src/phpDocumentor/Transformer/Transformer.php:141
PHP 14. phpDocumentor\Transformer\Transformer->applyTransformationToProject() /usr/share/php/phpDocumentor/src/phpDocumentor/Transformer/Transformer.php:275
PHP 15. phpDocumentor\Plugin\Graphs\Writer\Graph->transform() /usr/share/php/phpDocumentor/src/phpDocumentor/Transformer/Transformer.php:312
PHP 16. phpDocumentor\Plugin\Graphs\Writer\Graph->processClass() /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Graphs/Writer/Graph.php:58
PHP 17. phpDocumentor\Plugin\Graphs\Writer\Graph->checkIfGraphVizIsInstalled() /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Graphs/Writer/Graph.php:72
PHP 18. exec() /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Graphs/Writer/Graph.php:254
Unable to find the `dot` command of the GraphViz package. Is GraphViz correctly installed and present in your path? 32.682s
我知道graphiz已经安装并出现在我的路径中,因为:
〜$ dot -v
dot - graphviz version 2.36.0 (20140111.2315)
libdir = "/usr/lib/graphviz"
Activated plugin library: libgvplugin_dot_layout.so.6
Using layout: dot:dot_layout
Activated plugin library: libgvplugin_core.so.6
Using render: dot:core
Using device: dot:dot:core
The plugin configuration file:
/usr/lib/graphviz/config6
was successfully loaded.
render : cairo dot fig gd map pic pov ps svg tk vml vrml xdot
layout : circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
textlayout : textlayout
device : canon cmap cmapx cmapx_np dot eps fig gd gd2 gif gv imap imap_np ismap jpe jpeg jpg pdf pic plain plain-ext png pov ps ps2 svg svgz tk vml vmlz vrml wbmp x11 xdot xdot1.2 xdot1.4 xlib
loadimage : (lib) eps gd gd2 gif jpe jpeg jpg png ps svg xbm
此外,如果我以sudo的身份运行phpdoc,它的工作正常。上述错误仅在我以用户身份运行PHPDoc时出现。为了使它适用于我的特定情况,我需要它以用户身份工作。
我无能为力,但我认为在这种特殊情况下,这个问题与“无法解决问题”有关。比"无法找到点命令"。但不确定如何解决这个特定问题。
其他一些可能有用的信息:
Ubuntu 14.04
PHP 5.5.33
phpDocumentor version 2.8.5
total used free shared buffers cached
Mem: 992 512 479 9 55 319