compile php with gd and freetype support for jpgraph

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • luckyG
    New Member
    • Nov 2007
    • 3

    compile php with gd and freetype support for jpgraph

    I have php (5.2.4) compiled on redhat 4.0 as followed :
    Code:
    ./configure \
     --with-oci8=$ORACLE_HOME
     --with-apxs=/usr/local/apache/bin/apxs \
     --with-config-file-path=/usr/local/apache/conf \
     --enable-sigchild \
     --with-gd \
     --with-ttf=/usr/include/freetype2 \
     --with-freetype-dir=/usr/include/freetype2 \
     --with-gd-native-ttf \
     --enable-shared
    the make & make install runs without errors

    But when using the jpgraph, I get an error png image that there is no TTF-support and says to compile php with FreeType support.

    What I doing wrong?
    testjpgraph.php
    Code:
    <?php
    include ("/install_apache_standalone/jpgraph-1.21b/src/jpgraph.php");
    include ("/install_apache_standalone/jpgraph-1.21b/src/jpgraph_bar.php");
    
    $db_conn = ocilogon("****","****","***");
    $cmdstr = "select * from test";
    $parsed = ociparse($db_conn,$cmdstr);
    ociexecute($parsed);
    $nrows = ocifetchstatement($parsed, $results);
    for ($i = 0; $i < $nrows; $i++)
    {
      $data[] = $results["MARKS"][$i];
      $leg[] = $results["NAME"][$i];
    }
    
    $graph = new Graph(250,150,"auto");
    $graph->SetScale("textint");
    $graph->img->SetMargin(50,30,50,50);
    //$graph->AdjBackgroundImage(0.4,0.7,-1); //setting BG type
    //$graph->SetBackgroundImage("linux_pez.png",BGIMG_FILLFRAME); //adding image
    $graph->SetShadow();
    
    $graph->xaxis->SetTickLabels($leg);
    
    $bplot = new BarPlot($data);
    $bplot->SetFillColor("lightgreen"); // Fill color
    $bplot->value->Show();
    $bplot->value->SetFont(FF_ARIAL,FS_BOLD);
    $bplot->value->SetAngle(45);
    $bplot->value->SetColor("black","navy");
    
    $graph->Add($bplot);
    $graph->Stroke();
     ?>
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi.

    I would assume there is a problem with the FreeType TTF support on your system, although I would have thought the compiler would have picked up on that.

    Have you checked if the FreeType thing is working properly?
    Or if this is a bug in the PHP code itself?

    Comment

    • luckyG
      New Member
      • Nov 2007
      • 3

      #3
      Hi,

      Yes it is a bug in php I have downloaded 5.2.5 rc2 of php, and then it works.

      thanks for the reply.

      Regards

      Comment

      Working...