<div dir="ltr">Nick,<br>in mapcairo.c near line 857, function <br><br><div>int saveImageCairo (imageObj *img, mapObj *map, FILE *fp, outputFormatObj *format)</div><div><br></div><div>try changing fwrite to msIO_fwrite</div>
<div><br></div><div>In any case, please open an issue for this one so it doesn't get forgotten.</div><div><br></div><div>regards,</div><div>thomas<br><div><br><br><br>On 2 July 2013 06:29, Nick Webb <<a href="mailto:nickw@redwireservices.com">nickw@redwireservices.com</a>> wrote:<br>
><br>><br>> On Mon, Jul 1, 2013 at 5:50 PM, Frank Warmerdam <<a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>> wrote:<br>>><br>>> Nick,<br>>><br>>> As I vaguely recall from when I worked on fastcgi support in MapServer, only output formats that can be redirected through the low level mapserver io layer (ms_io*.c) will work properly in fastcgi mode.  I'm guessing the svg encoder just writes directly to stdout.  If my theory is correct, non-trivial code changes would be necessary to make this work.<br>
>><br>>><br>><br>> Thanks Frank, that actually makes perfect sense.  I'm not all that familiar, but it seems that I read somewhere that a legacy version of mapserver had native SVG support, which in turn would work with fastcgi?  Seems I also read native support is on the wish list for a future release as well. <br>
>><br>>><br>>><br>>><br>>> On Mon, Jul 1, 2013 at 5:16 PM, Nick Webb <<a href="mailto:nickw@redwireservices.com">nickw@redwireservices.com</a>> wrote:<br>>>><br>>>> List,<br>
>>><br>>>> I've really tried hard to nail this down, but it makes no sense to me.  I'm not a map guy, but am a system administrator for one.<br>>>><br>>>> We have a mapserver setup that works fine for both PNG and SVG when we use the standard apache cgi module.  When we switch to mod_fcgid, however, SVG displays no output in the browser and instead seems to output proper SVG/XML to the apache error log!  PNG continues to work fine.<br>
>>><br>>>> I'm flabbergasted and nothing I try seems to work.  I even set it up on another server and I get the same result, given I'm following the same build steps.<br>>>><br>>>> Any ideas on where I can go next?<br>
>>><br>>>> Perhaps the SVG is not really valid, but I've copied and pasted the XML/SVG from the error_log to a static file, and that also displays fine via a browser.<br>>>><br>>>> Here is the error_log output:<br>
>>><br>>>> <?xml version="1.0" encoding="UTF-8"?><br>>>> <svg xmlns="<a href="http://www.w3.org/2000/svg">http://www.w3.org/2000/svg</a>" xmlns:xlink="<a href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</a>" width="200pt" height="154pt" viewBox="0 0 200 154" version="1.1"><br>
>>> <g id="surface0"><br>>>> . . . <br>>>> </g><br>>>> </svg><br>>>> [Tue Jul 02 00:12:11.947149 2013] [fcgid:warn] [pid 2398] [client <a href="http://50.197.85.9:2118">50.197.85.9:2118</a>] mod_fcgid: stderr: CGI Request 1 on process 2405<br>
>>> [Tue Jul 02 00:12:11.947213 2013] [fcgid:warn] [pid 2398] [client <a href="http://50.197.85.9:2118">50.197.85.9:2118</a>] mod_fcgid: stderr: msDrawMap(): rendering using outputformat named svg (CAIRO/SVG).<br>
>>> [Tue Jul 02 00:12:11.947223 2013] [fcgid:warn] [pid 2398] [client <a href="http://50.197.85.9:2118">50.197.85.9:2118</a>] mod_fcgid: stderr: msDrawMap(): WMS/WFS set-up and query, 0.000s<br>>>> [Tue Jul 02 00:12:11.947230 2013] [fcgid:warn] [pid 2398] [client <a href="http://50.197.85.9:2118">50.197.85.9:2118</a>] mod_fcgid: stderr: msDrawMap(): Layer 0 (thematic), 0.040s<br>
>>> [Tue Jul 02 00:12:11.947238 2013] [fcgid:warn] [pid 2398] [client <a href="http://50.197.85.9:2118">50.197.85.9:2118</a>] mod_fcgid: stderr: msDrawMap(): Drawing Label Cache, 0.000s<br>>>> [Tue Jul 02 00:12:11.947245 2013] [fcgid:warn] [pid 2398] [client <a href="http://50.197.85.9:2118">50.197.85.9:2118</a>] mod_fcgid: stderr: msDrawMap() total time: 0.040s<br>
>>> [Tue Jul 02 00:12:11.947253 2013] [fcgid:warn] [pid 2398] [client <a href="http://50.197.85.69:2118">50.197.85.69:2118</a>] mod_fcgid: stderr: msSaveImage(stdout) total time: 0.005s<br>>>> [Tue Jul 02 00:12:11.947261 2013] [fcgid:warn] [pid 2398] [client <a href="http://50.197.85.9:2118">50.197.85.9:2118</a>] mod_fcgid: stderr: mapserv request processing time (msLoadMap not incl.): 0.045s<br>
>>> [Tue Jul 02 00:12:11.947268 2013] [fcgid:warn] [pid 2398] [client <a href="http://50.197.85.9:2118">50.197.85.9:2118</a>] mod_fcgid: stderr: msFreeMap(): freeing map at 0x8881a0.<br>>>><br>>>><br>
>>> DEBUG 5 is set logging to the same file (stderr).<br>>>><br>>>><br>>>> ./mapserv -v<br>>>> MapServer version 6.2.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=GD SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE<br>
>>><br>>>><br>>>> Thanks,<br>>>> Nick<br>>>><br>>>> _______________________________________________<br>>>> mapserver-users mailing list<br>>>> <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
>>> <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>>>><br>>><br>>><br>>><br>>> --<br>>> ---------------------------------------+--------------------------------------<br>
>> I set the clouds in motion - turn up   | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a><br>>> light and sound - activate the windows | <a href="http://pobox.com/~warmerdam">http://pobox.com/~warmerdam</a><br>
>> and watch the world go round - Rush    | Geospatial Software Developer<br>><br>><br>><br>> _______________________________________________<br>> mapserver-users mailing list<br>> <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>><br></div></div></div>