0
私はPhpgraphlibを使用して私のWebページでグラフを視覚化しようとしています。Phpgraphlib:内部サーバーエラー
PHPスクリプト(graph.php):
<?php
include("phpgraphlib.php");
error_reporting(E_ALL^E_DEPRECATED^E_NOTICE);
$graph=new PHPGraphLib(550,350);
$link = mysql_connect('127.0.0.1', 'xxxx', 'xxxx') or die('Could not connect: ' . mysql_error());
mysql_select_db('quality') or die('Could not select database');
$dataArray=array();
//get data from database
$sql="SELECT country, tot_reg FROM ntr_perf_no_net WHERE data = '2016-09-05'";
$result = mysql_query($sql) or die('Query failed: ' . mysql_error());
if ($result) {
while ($row = mysql_fetch_assoc($result)) {
$country=$row["country"];
$reg=$row["tot_reg"];
//add to data areray
$dataArray[$country]=$reg;
}
}
//configure graph
$graph->addData($dataArray);
$graph->setTitle("Tot registration per Country");
$graph->setGradient("lime", "green");
$graph->setBarOutlineColor("black");
$graph->createGraph();
?>
Webページ(graph.html): 私は、次のコードを使用し
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Graph</title>
</head>
<body>
<h3>This is where I want to display my graph</h3>
<img src="graph.php" />
</body>
</html>
それは非常に簡単ですが、私は500を取得します内部サーバーエラー。 私は、PHPスクリプトがサーバーによって読み込まれていることを知っています(私はPHPスクリプトに意味的なエラーを付けるとApacheログに表示されます)ので、何が間違っているのか理解できません。 SQLクエリがOKです。ファイル(Phpgraphlib.php、graph.html、およびgraph.php)は、777パーミッション(ファイルとディレクトリ)を持つ同じディレクトリにあります。
私を助けることができますか?
おかげで、私はGDをインストールするのを忘れ