[mapserver-users] Couldn't run perl mapscript under Apache
Puneet Kishor
pkishor at GeoAnalytics.com
Sat Nov 9 17:36:00 PST 2002
On Saturday, November 9, 2002, at 11:09 AM, krung wrote:
> Hi Lowell, Puneet
>
> I tried as you told me. If I ran with command line, mapserver.log was
> created whem error occured. But when run on Apache, mapserver's never
> created as error occured. (access right with this directory'd set to
> 777 already) So I checked it at error_log of httpd log file, but it's
> non-sense to me. It showed only "Premature of script headers:
> /usr/mapserver/testmap.pl".
>
> And I tried to change script logic flow as you, Puneet, told me. It's
> the same error as before (Internal Server Error).
Krung,
You really have to tell us what the error is. The "Internal Server
Error" is the end result. Usually, that end result is the result of one
or more errors happening in tandem. Do the following (assuming your
apache log is under /var/log/httpd/)... type "tail -f
/var/log/httpd/error_log". This will output the last few lines of the
log file on your stdout, and keep the handle open. Now run your
mapserver script via the web server. You will see the tail output
change. Copy the lines that were outputted as a result of your last
attempt to load the mapserver page. Mail that to the list. Then we will
know better what is going on.
Another question. In your message you say
>>> $img = $map->draw(); # <---- error took place here
How do you know that the error took place there? Usually the script
breaks because of an error before the break.
Again, send us all the error messages. Only then can we help.
I am assuming that perl runs fine as cgi on your computer otherwise.
pk/
>
> Do I have to specially configure when I create mapserver program? Any
> comments, help, advice would be graceful.
>
> Thank you
> Krung
>
>
> ---------- Original Message ----------------------------------
> From: "Lowell Filak"<lfilak at medinaco.org>
> Date: Thu, 07 Nov 2002 08:24:06 -0500
>
>> You can try adding the line noted below and see if a file
>> mapserver.log exists in the current directory and if it reports an
>> error.
>> If the mapserver.log file isn't created then try changing the path of
>> the log file to somewhere writeable by the apache process.
>> HTH
>> Lowell F.
>>
>> The following message was sent by "Krung Saengpole" <krung at cad.go.th>
>> on Thu, 7 Nov 2002 18:45:20 +0700.
>>
>>> Hello all,
>>>
>>> I had trouble getting perl mapscript run on Apache 1.3.26 under RH
>>> 7.2. Mapscript compiled from mapserver 3.6.3.
>>>
>>> My script is:
>>>
>>> #!/usr/bin/perl
>>> use mapscript;
>>> use CGI qw/:standard/;
>>
>> $ENV{MS_ERRORFILE} = "mapserver.log"; <--Try adding this line.
>>
>>>
>>> print header();
>>> print start_html();
>>> $map = new mapObj('mapfile.map');
>>> $img = $map->draw(); # <---- error took place here
>>> $img->saveImage('file.png', $mapscript::MS_PNG,1,1,0);
>>> ....
>>> ....
>>>
>>> What I did wrong with this script or anything else? But I could run
>>> this script at command line. I'm very new to Linux. I tried to write
>>> a script that open database and run under Apache, it had no problem.
>>> So, I thought it should not be wrong with Apache configuration.
>>>
>>> Thank you in advance.
>>> Krung.
>>
>>
>>
More information about the MapServer-users
mailing list