[MS4W-Users] Does PHP-Mapscript-FCGI cache the map-object?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view

[MS4W-Users] Does PHP-Mapscript-FCGI cache the map-object?

Hi list,
I'm using ms4w in version 3.0.1, Apache 2.2.17, PHP 5.3.5 in
Fast-CGI-Mode (mod_fcgid/2.3.6 ) and just had a strange problem.

I use only PostGIS-Layers. The layers in the mapfile are all set to
"STATUS OFF" and have no "connection" and "data"-parameters, because
this is set dynamicaly by mapscript. They use "PROCESSING

By mistake ther were errors in former runs of the map-creation, the
"data"-String had some SQL-Errors. Afterwards the corrected PHP-Script
still threw lots of error-messages "msPostGISLayerWhichShapes(): Query
error. Error (FEHLER:  Syntaxfehler bei »AND« LINE 5: ...ew_gewaesser AS
"gewaesser_obj.gewaesser"  WHERE  AND  AND", although at that time I
only had loaded the map-Object ($map_object =
ms_newMapObj($path_to_the_map_file);), set the Size
($map_object->setSize($map_width, $map_height);) and so the layers had
no data and no connection params and status off.

These messages did not disappear until shutting down and restarting the
Apache (and the PHP-FCGI-Process).

That leads me to the assumption, that somewhere the map-object (with all
errors) is cached and reused within the FCGI-Process and overwrites the
new loaded mapfile. A somehow disturbing behaviour...

Is this a bug or did I oversee something?

MS4W-Users mailing list
[hidden email]
Reply | Threaded
Open this post in threaded view

Re: [MS4W-Users] Does PHP-Mapscript-FCGI cache the map-object?

Hello Ludwig,

I don't have your answer, but I can give you my thoughts when I read this:

- what happens when you make sure to check Task Manager that the mapserv.exe process is not listed there, after you make changes to your mapfile?

- I wonder if any of the mod_fcgid parameters apply to your case (http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html)

That's all I have at the moment at a quick glance :)


Jeff McKenna
MapServer Consulting and Training Services

Reply | Threaded
Open this post in threaded view

Re: [MS4W-Users] Does PHP-Mapscript-FCGI cache the map-object?

This post has NOT been accepted by the mailing list yet.
In reply to this post by ludwig@kni-online.de
Hi, Ludwig, I've been having trouble with this exact issue, and the answer seems to be yes, the object and its errors are stored within the fcgi process.
I have to restart both the web server (nginx) and the fcgi and fpm (process manager) to achieve control over the map object again, even in new instances.
It's a bit annoying, and the remedy may to be the careful usage of the free() method on the map object after every manipulation. With that procedure you will get rid of the failed object and will be able to manipulate the new instance.