2016-01-05 72 views
0

做一些PHPgraphlib的測試,創建圖形的圖像時出現問題使用其中的一個示例。PHPgraphlib沒有創建圖像

 include('lib/phpgraphlib.php'); 
     include('lib/phpgraphlib_pie.php'); 
     $graph = new PHPGraphLibPie(400, 200, 'img/graph.png'); 
     $data = array("CBS" => 6.3, "NBC" => 4.5,"FOX" => 2.8, "ABC" => 2.7, "CW" => 1.4); 
     $graph->addData($data); 
     $graph->setTitle('8/29/07 Top 5 TV Networks Market Share'); 
     $graph->setLabelTextColor('50,50,50'); 
     $graph->setLegendTextColor('50,50,50'); 
     $graph->createGraph(); 

沒有圖像在文件夾或根目錄中創建? GD已啓用。

回答

1

確保您具有對目標目錄的寫入權限。例如,如果Apache Web服務器正在執行php腳本,則Apache用戶應該有權寫入該目錄。