title: CGI script cant create file
body: <p>I have the following CGI script that launches a module that creates a PNG file and then shows it.</p>
  
  <pre><code>#!/usr/bin/perl
  
  use RRDs;
  use CGI;
  
  main:
  {
  my $cgi = new CGI;
  my $filename = $cgi-&gt;param('filename');
  print "Content-type: text/html\n\n";
  my $curr_time = time();
  my $start_time = $curr_time-3600;
  RRDs::graph("$filename", "--start", "$start_time", "DEF:DiskC=c.rrd:DiskC:AVERAGE", "AREA:DiskC#0000FF");
  my $err = RRDs::error();
  print "&lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;Disk C Utilization&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H1&gt;Disk C Utilization&lt;/H1&gt;&lt;BR&gt;$err&lt;img src=\"$filename\"/&gt;&lt;/BODY&gt;&lt;/HTML&gt;";
  }
  </code></pre>
  
  <p>The graph method says that can't create the PNG file. If I run this script in a command like it works fine so I think it's a matter of permissions. I already set chmod 755 on the cgi-script folder. What do you suggest? Is this related to Apache2 settings?</p>