Keine Image Funktionen in CronJob!

Kidix

Grünschnabel
Hi,


ich habe nen CronJob der ein Grafikscript ausführt...aber irgendwie werden sämtliche Image Funktionen ignoriert. Sobald ich die URL direkt im Browser eingebe gehts!

Kann mir wer sagen wieso?

Gruß

Kidix
 
Ungefähr so sieht der Quellcode aus:

Code:
<?php
  echo("hallo");
  
  function Umrandung($imm, $farbe, $breite, $hoehe) {
  	ImageLine ($imm, 0, 0, 0, $hoehe-1, $farbe);
  	ImageLine ($imm, 0, 0, $breite-1, 0, $farbe);
  	ImageLine ($imm, $breite-1, 0, $breite-1, $hoehe-1, $farbe);
  	ImageLine ($imm, 0, $hoehe-1, $breite-1, $hoehe-1, $farbe);
  	}
  
  function logo_brand($src, $logo, $quality = 100) {
    $info = getimagesize($src);
    if ($info[0] > 1) {
  	$logo_size = getimagesize($logo);
  	$logo = imagecreatefromjpeg($logo);
  	$bild = imagecreatefromjpeg($src);
  	imagecopy($bild, $logo, 175, 60, 0, 0, $logo_size[0], $logo_size[1]);
  	imagejpeg($bild, $src, $quality);
  	return TRUE;
    } else return FALSE;
  }
  
  include('../daten.php');			
 $conn_id = mysql_connect('localhost',web1',$mysqlpass); 		 	
 mysql_select_db('usr_web1_1',$conn_id); 		 		 			
  $result = mysql_query("SELECT * FROM grafik WHERE user = 'Alex'")
  or die(mysql_error());
  while($row = mysql_fetch_array($result)) {
  
  $BB = "280";
  $HH = "95";
  $im = @ImageCreate ($BB, $HH)
  	  or die ("Kann keinen neuen GD-Bild-Stream erzeugen");
   
  $background_color = ImageColorAllocate ($im, 236, 240, 243);
  $black = imagecolorallocate($im, 0, 0, 0);
  $blue = imagecolorallocate($im, 0, 85, 153);
  ImageString($im, 2, 5, 5, 'Uptime', $blue);
  ImageString($im, 1, 5, 20, $row['uptime'], $black);
  ImageString($im, 2, 5, 35, 'Festplattenplatz belegt', $blue);
  ImageString($im, 1, 5, 50, $row['festplatte'].' %', $black);
  ImageString($im, 2, 5, 65, 'Prozessor', $blue);
  ImageString($im, 1, 5, 80, $row['prozessor'], $black);
  
  
  $SW = ImageColorAllocate($im, 0, 0, 0);
  Umrandung($im, $SW, $BB, $HH); 
  ImageJPEG ($im,"mygfx.jpg",100);# bild wird erstlt und gesendet
  logo_brand("mygfx.jpg", "status.jpg");
  ImageDestroy($im);
  
  
  }
  
  
  
  mysql_close($conn_id);
  
  
  
  
  
  ?>

Wie gesagt, wenn ich URL im Browser eingebe gehts, wenn ichs per CronJob ausführe gibt er zwar das echo aus, die grafik wird aber nicht erstellt!

Kidix
 
Ok, das CronJob wirft folgenden Fehler aus!

<br />
<b>Warning</b>: imagejpeg() [<a href='http://www.php.net/function.imagejpeg'>function.imagejpeg</a>]: Unable to open 'mygfx.jpg' for writing in <b>/srv/www/htdocs/web81/html/src/gerstellen.php</b> on line <b>48</b><br />
<br />
<b>Warning</b>: imagejpeg() [<a href='http://www.php.net/function.imagejpeg'>function.imagejpeg</a>]: Unable to open 'mygfx.jpg' for writing in <b>/srv/www/htdocs/web81/html/src/gerstellen.php</b> on line <b>18</b><br />


Aber wieso?

Gruß

Kidix
 
Zurück