I tried your sequence on my mapfile and it worked.&nbsp; My original code was missing this&nbsp; at the bottom:<br><br>ms_iogetStdoutBufferBytes();<br><br>I'd been experimenting with&nbsp; header(...) and ms_ioresethandlers()&nbsp; but not necessarily at the same time, and without the "Bytes" func.&nbsp; I need to go back and read the descriptions of these&nbsp; ms_io funcs.<br><br>many thanks,<br>Robert<br><br><b><i>Yewondwossen Assefa &lt;yassefa@dmsolutions.ca&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Robert,<br><br>  what does you php script looks like?  Quick test I did with a png <br>output and works looks like this:<br><br>  request :
 <br>http://localhost/msapps/wxs/test.php?SERVICE=WMS&amp;VeRsIoN=1.1.1&amp;Request=GetMap&amp;LAYERS=WorldGen_Outline&amp;FORMAT=png&amp;WIDTH=400&amp;HEIGHT=300&amp;SRS=EPSG:4326&amp;FORMAT=png&amp;WIDTH=400&amp;HEIGHT=300&amp;STYLES=&amp;BBOX=-180.0,-90.0,180.0,90.0&amp;SLD=http://localhost/msapps/world_testdata/tests/sld_tests/sld_line_multi_filter.xml<br><br>test.php<br><br><br><br>dl("php_mapscript.dll");<br><br>$request = ms_newowsrequestobj();<br><br>$request-&gt;loadparams();<br><br>ms_ioinstallstdouttobuffer();<br><br>$oMap = ms_newMapobj("f:/msapps/world_testdata/map/world_testdata.map");<br><br>$oMap-&gt;owsdispatch($request);<br><br>$contenttype = ms_iostripstdoutbuffercontenttype();<br><br>//if ($contenttype == 'image/png')<br>    header('Content-type: image/png');<br><br>ms_iogetStdoutBufferBytes();<br><br>ms_ioresethandlers();<br><br>?&gt;<br><br><br>Best Regards<br><br><br>ROBERT HOLLINGSWORTH wrote:<br>&gt; Hello,<br>&gt; I've loaded latest MS4W 2.x
 (therefore PHP 5.x)<br>&gt;  and am trying to verify Mapscript's<br>&gt; OwsRequestObj and $mapobj-&gt;owsdispatch()<br>&gt; on a fairly ordinary shp-based mapfile<br>&gt; that works well where mapserv.exe is<br>&gt; the WMS server.<br>&gt; <br>&gt; The requestobj seems healthy and<br>&gt; owsdispatch seems successful on WMS<br>&gt; GetCapabilities.  On a GetMap,<br>&gt; owsdispatch is returning MS_SUCCESS,<br>&gt; but all the image output formats are<br>&gt; coming thru damaged or truncated in<br>&gt; some way.  When running GetMap<br>&gt; in a browser, there are corruption<br>&gt; messages for PNG and GIF,<br>&gt; while JPG displays as a very "disturbed"<br>&gt; image that gdalinfo indicates is currupted.<br>&gt; <br>&gt; The docs suggest that owsdispatch() should<br>&gt; be able to dump the image to the client without<br>&gt; further manipulation, so I don't know what I<br>&gt; might be missing.<br>&gt; <br>&gt; Or if my environment is somehow tainted from<br>&gt; older
 MS4Ws (on PHP 4).  I uninstalled the old<br>&gt; apache that I was using and installed the new<br>&gt; MS4W in c:\ to be as generic as possible.<br>&gt; <br>&gt; Any ideas out there?<br>&gt; <br>&gt; thanks,<br>&gt; Robert H.<br>&gt; <br>&gt; <br>&gt; ------------------------------------------------------------------------<br>&gt; <br>&gt; _______________________________________________<br>&gt; mapserver-users mailing list<br>&gt; mapserver-users@lists.osgeo.org<br>&gt; http://lists.osgeo.org/mailman/listinfo/mapserver-users<br><br><br>-- <br>----------------------------------------------------------------<br>Assefa Yewondwossen<br>Software Analyst<br><br>Email: assefa@dmsolutions.ca<br>http://www.dmsolutions.ca/<br><br>Phone: (613) 565-5056 (ext 14)<br>Fax:   (613) 565-0925<br>----------------------------------------------------------------<br><br></blockquote><br>