Hello,<br>I&#39;ve tried to get mapserver up and running with GDAL to display a raster image from a php webpage but have been largely unsuccessful.&nbsp; This post will be relatively long as I describe all that I&#39;ve tried to do to get it working.&nbsp; My development platform is Fedora Core 6.
<br><br>First I tried all the needed packages obtained from the Fedora repositories.&nbsp; I ran in to issues with php and gd not cooperating.&nbsp; So I downloaded php from and built from source (v5.2.1).<br><br>After php was installed and operational, I tried to get mapserver running (
v4.10.1).&nbsp; After I successfully built (with config options --without-pdf --with-httpd=/usr/sbin/httpd --with-php=/usr/local/src/php-5.2.1 --with-proj --with-gdal), I copied the php_mapscript.so file to the php modules direcotry.&nbsp; I started receiving errors along the lines of no output format for GTIFF ( I appologies for the vagueness, but I didn&#39;t write it down and I don&#39;t remember what it specifically was).
<br><br>Next, I downloaded from source GDAL and built it (with config options --with-png --with-jpeg --with-gif --with-libtiff --with-hdf4 --with-hdf5 --with-jasper --with-mysql).&nbsp; Then I did a make install and rebuild mapserver with the option --with-gdal=/usr/local/bin/gdal-config.&nbsp; I also copied over the new php_mapscript.&nbsp; At this point, I am still unable to draw a singular raster image with mapserver.&nbsp; My exact error message is:
<br><br><b>Warning</b>:  [MapServer Error]: msDrawMap(): Failed to draw layer named &#39;TestLayer&#39;.
 in <b>/var/www/html/ryan/test.php</b> on line <b>9</b><br>
<br>
<b>Warning</b>:  [MapServer Error]: msDrawRaster(): (/usr/share/images/test.png)
 in <b>/var/www/html/ryan/test.php</b> on line <b>9</b><br><br>I&#39;ve tried an older version of GDAL (1.4.0) with the same results.&nbsp; gdalinfo correctly opens and displays info on my image file, resolution and type (png).
<br><br>Here is my php file:<br>&lt;?php<br><br>$map_path=&quot;/var/www/html/ryan/map/&quot;;<br><br>dl(&#39;php_mapscript.so&#39;);<br><br>$map = ms_newMapObj($map_path.&quot;test.map&quot;);<br>//$map-&gt;selectOutputFormat(&quot;image/png&quot;);
<br>$image=$map-&gt;draw();<br>$image_url=$image-&gt;saveWebImage();<br><br>?&gt;<br><br>&lt;HTML&gt;<br>&nbsp;&nbsp;&nbsp; &lt;HEAD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TITLE&gt;Test&lt;/TITLE&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/HEAD&gt;<br>&nbsp;&nbsp;&nbsp; &lt;BODY&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;IMG SRC=&lt;?php echo $image_url; ?&gt; &gt;
<br>&nbsp;&nbsp;&nbsp; &lt;/BODY&gt;<br>&lt;/HTML&gt;<br><br>and here is my mapfile:<br>Map<br>&nbsp;&nbsp;&nbsp; Name TESTMAPFILE<br>&nbsp;&nbsp;&nbsp; Status On<br>&nbsp;&nbsp;&nbsp; Imagetype PNG<br>&nbsp;&nbsp;&nbsp; Size 800 600<br>&nbsp;&nbsp;&nbsp; Extent -82 40 -80 42 #example location<br>&nbsp;&nbsp;&nbsp; Units dd<br>
<br>&nbsp;&nbsp;&nbsp; Web<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Imagepath &quot;/var/www/html/ryan/map/&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Imageurl &quot;/ryan/map/&quot;<br>&nbsp;&nbsp;&nbsp; End<br><br>&nbsp;&nbsp;&nbsp; Layer<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name &quot;TestLayer&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type Raster<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Status On
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Data &quot;/usr/share/images/test.png&quot;<br>&nbsp;&nbsp;&nbsp; End<br><br>&nbsp;&nbsp;&nbsp; OutputFormat<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name png<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Driver &quot;GD/PNG&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Mimetype &quot;image/png&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ImageMode RGB<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Extension &quot;png&quot;
<br>&nbsp;&nbsp;&nbsp; End<br><br>End<br><br>I am at the end of my rope trying to get this to work.&nbsp; If anyone can provide any direction, I would greatly appreciate any insight.<br><br>Thanks,<br>Ryan<br><br>