duanjia2415 2017-01-17 05:44
浏览 175
已采纳

如何在Debian 7.7上安装graphviz?

I'm novice in programming. I just installed my Debian and installed following packages

dpkg -l | grep graph
ii  graphviz                           2.26.3-14+deb7u2              amd64        rich set of graph drawing tools
ii  libart-2.0-2:amd64                 2.3.21-2                      amd64        Library of functions for 2D graphics - runtime files
ii  libcairo2:amd64                    1.12.2-3                      amd64        The Cairo 2D vector graphics library
ii  libcdt4                            2.26.3-14+deb7u2              amd64        rich set of graph drawing tools - cdt library
ii  libcgraph5                         2.26.3-14+deb7u2              amd64        rich set of graph drawing tools - cgraph library
ii  libgraph4                          2.26.3-14+deb7u2              amd64        rich set of graph drawing tools - graph library
ii  libgraphviz-dev                    2.26.3-14+deb7u2              amd64        graphviz libs and headers against which to build applications
ii  libgvc5                            2.26.3-14+deb7u2              amd64        rich set of graph drawing tools - gvc library
ii  libgvpr1                           2.26.3-14+deb7u2              amd64        rich set of graph drawing tools - gvpr library
ii  libpathplan4                       2.26.3-14+deb7u2              amd64        rich set of graph drawing tools - pathplan library
ii  libxdot4                           2.26.3-14+deb7u2              amd64        rich set of graph drawing tools - xdot library
ii  openssl                            1.0.1e-2+deb7u12              amd64        Secure Socket Layer (SSL) binary and related cryptographic tools

I also used following program to start with Graphviz:

<?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();
?>

But What I get is:

addEdge(array('wake up' => 'visit bathroom')); $gv->addEdge(array('visit bathroom' => 'make coffee')); $gv->image(); ?>

Please let me know how to deal with this problem ?

Regards

  • 写回答

1条回答 默认 最新

  • dounaidu0204 2017-01-17 05:57
    关注

    You need to install the PHP bindings for GraphViz. I don't have a Debian image to try this on, but try:

    sudo apt-get install libgv-php5
    

    If that doesn't work, then try:

    sudo apt-cache search libgv | grep -i php
    

    UPDATE: The code give above works against a clean Debian 7 image after the following commands:

    sudo apt-get update
    sudo apt-get install apache2 libapache2-mod-php5 libgv-php5 graphviz vim php-pear
    sudo pear install Image_GraphViz
    
    # Copy the file above to test.php
    php5 test.php
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 shape_predictor_68_face_landmarks.dat
  • ¥15 slam rangenet++配置
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题