[Mapserver-users] RH8 and GD

Arthur, John John.Arthur at T-Mobile.com
Tue Mar 4 11:07:31 PST 2003


Here is a test script: Note if the output is changed to gif or jpeg it will work.

<?php 
Header("Content-type: image/png"); 

$image = imagecreate(300, 300);

$red = ImageColorAllocate($image, 204, 0, 0);
$white = ImageColorAllocate($image, 255, 255, 255);
$green = ImageColorAllocate($image, 0, 150, 0);
$black = ImageColorAllocate($image, 0, 0, 0);

ImageFilledRectangle($image, 0, 0, 300, 300, $white);  // white background
ImageRectangle($image, 10, 10, 290, 290, $red);  // red frame

$points = array(
		"0" => "40", 	// x1
		"1" => "50", 	// y1
		"2" => "20", 	// x2
		"3" => "240", 	// y2
		"4" => "60", 	// x3
		"5" => "60", 	// y3
		"6" => "240", 	// x4
		"7" => "20", 	// y4
		"8" => "50", 	// x5
		"9" => "40", 	// y5
		"10" => "10", 	// x6
		"11" => "10", 	// y6
); 

$number = count($points) / 2;

ImageString($image, 5, 15, 250, "There are $number points", $black);


ImageFilledPolygon($image, $points, $number, $red);  


for ($i = 1; $i <= 5; $i++) {  // five fonts
	$k = (($i * 10) + 70);
	ImageString($image, $i, 90, $k, "PHP images", $green); 
}

imagepng($image);  // render image
imagedestroy($image); // free memory

?> 


-----Original Message-----
From: woodbri at swoodbridge.com [mailto:woodbri at swoodbridge.com]
Sent: Tuesday, March 04, 2003 1:26 PM
To: Arthur, John; mapserver-users at lists.gis.umn.edu
Subject: Re: [Mapserver-users] RH8 and GD


John,

Can you post a simple script that does this so I can try it on my 
config.

Thanks,
  -Steve W.

On 4 Mar 2003 at 9:31, Arthur, John wrote:

> This is not only related to Mapscript, but anything related to gd and
> php.  I have read and followed the
> http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?RedHat8AndMapserver37 to
> a "T".  Everything compiles fine and normal php scripts run great. 
> But, every time I run a php script that outputs an image using the gd
> library (jpgraph, mapscript, or gd examples) Apache returns this
> error: 
> 
> ------------------------------
> 
> Server error!
> 
> The server encountered an internal error and was unable to complete
> your request. 
> 
> Error message: 
> Premature end of script headers: php 
> 
> If you think this is a server error, please contact the webmaster 
> 
> Error 500
> 
> localhost
> Tue 04 Mar 2003 12:20:18 PM EST 
> Apache/2.0.40 (Red Hat Linux) 
> 
> ------------------------------
> 
> There is nothing in the logs except "Premature end of script headers:
> php".  I have tried this with PHP 4.3.1 - GD 2.0.11 and PHP 4.2.3 - GD
> 2.0.7, with the same results.  Does anybody have a clue what the issue
> might be?  Is it related to Apache 2.0?  BTW, the mapserv cgi using
> the Itasca demo works just great.
> 
> Thanks,
> 
> John Arthur
> RF Technician
> Office:   (757) 490-7221
> Cellular: (757) 839-0021
> Email: john.arthur at t-mobile.com
> T-Mobile USA
> Get more from life
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 




More information about the MapServer-users mailing list