Mapscript in mod_perl: frequent errors in mapObj->new

Markus Spring rgu at ems.muenchen.de
Mon Jun 5 10:18:32 EDT 2000


Hello list,
I am trying to use Mapscript in an Apache::mod_perl content handler.
The body of the handler I derived from a simple commandline-script which
creates
images without problem.

package Apache::perlmapserv;
use strict;
use mapscript;
use Apache::Constants qw(:common DONE);

sub handler {
  my $r = shift;          # request-Object
  my @args = $r->args;
  make_map($r, \@args);
  return OK;
}

sub make_map{
  my ($r, $r_args) = @_;
  my $mapfile = extract_args($r_args, 'map'); # get name of mapfile
  $r->exit(DONE) unless -r $mapfile;
  my $map = mapObj->new($mapfile) or $r->exit(DONE);  
  ^---- when it crashes, then in this line!

The script runs fine two or three times, then it complains that it fails
in the line of the "new mapObj" request.
After having used the cgi-mapserv for a time I can again use the
mod_perl version for 
a limited number of calls.
I am running the programs on a linux SuSE 6.4 system. Kernel 2.2.14,
Perl 5.005_03.
For my knowledge, this points to a problem with a shared library.

I would be very glad, if someone could point me out what's happening
there.

Kind regards - markus



More information about the mapserver-users mailing list