Using Demo in the Wiki Causes All My PHP/Mapscript Examples to Die

Daniel Morissette dmorissette at MAPGEARS.COM
Fri Nov 2 15:05:14 EDT 2007


Are you using PHP as an Apache module or as a CGI?
If using PHP as a module then what you got could be the symptoms of a 
memory trashing problem which over time corrupts/kills all Apache child 
processes.

The easy workaround would be to switch to using PHP as a CGI, this way 
every request gets a new fresh process to work with and you avoid the 
problem.

However if possible we should try to identify the source of the problem, 
and if it's a bug in MapServer then try to fix it.

First, the usual suspects: GD... if your PHP has GD enabled, then is it 
using the same copy of GD as PHP MapScript? If PHP uses its bundled GD 
that could be a problem because MapScript likely uses the system GD and 
you have two different versions of GD used in the same process. It's 
important that both PHP and MapServer/MapScript use the system GD.

If you are convinced that conflicting GD versions is not the cause of 
the problems then I'd suggest that you try again with MapServer 5.0. If 
you can reproduce the bug with 5.0 then please file a ticket in Trac 
with as much detail as you can, including a script + mapfile to reproduce.

Daniel


Bill Thoen wrote:
> I've been experimenting with PHP/mapscript and came across an example of 
> how to display points dynamically (it's in the wiki at 
> http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PHPMapScriptAddPoint), and 
> so I wanted to try it.
> 
> It seems to work for several points in a row (basically moving a single 
> point to the next place I click) but after about 10 clicks or so, the 
> application dies with a loadLayer() error (which causes a cascade of 
> subsequent errors.) Worse, I discover that when this happens NONE of my 
> other PHP/mapscript applications will work, even though they've been 
> working fine and use other data sources and map files. I have to reboot 
> my machine to get them to work again.
> 
> I've added a call to $pt->free() following the line with $pt->draw() in 
> it and fixed the parameter list in click2map() to include the 
> $map->extent, but that doesn't seem to cure it.
> 
> I'm using MapServer 4.10.0 and I think mapscript 4.8, and this is all 
> running on Fedora Core 5 Linux machine.
> 
> Does anyone have any idea what's happening and how I can correct it?
> 
> TIA,
> - Bill Thoen


-- 
Daniel Morissette
http://www.mapgears.com/



More information about the mapserver-users mailing list