[MS4W-Users] Does PHP-Mapscript-FCGI cache the map-object?
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...
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.