>Number: 1792
>Category: os-windows
>Synopsis: Command line / service differences (Service fails to run CGI
>correctly)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apache
>State: open
>Class: sw-bug
>Submitter-Id: apache
>Arrival-Date: Thu Feb 12 06:50:00 PST 1998
>Last-Modified:
>Originator: [EMAIL PROTECTED]
>Organization:
apache
>Release: 1.3b3
>Environment:
NT 4.0, SP3
>Description:
I have a Perl script that Apache executes fine when running from the command
line. When I install/run it as a service, it fails.
Here's the script (it recursively prints a directory contents):
#!c:\program files\perl\bin\perl.exe
print "Content-type: text/html\n\n";
print qq#<HTML>\n<BODY BGCOLOR="FFFFFF">\n<TT>\n#;
$root = "P:\\Documents\\LogItems";
my $RECURSION_LIMIT = 5;
my $recursion_level = 0;
print "<H3>PHFARS Log Items\n</H3>";
recurse($recursion_level, $root);
print "</BODY>\n</HTML>";
exit 0;
sub recurse
{
my ($level) = $_[0] ;
my ($root) = $_[1];
opendir(DIR, $root);
foreach $file (sort {$b cmp $a} (readdir(DIR)))
{
unless ($file =~ /^\./)
{
if( -d "$root\\$file")
{
print "<blockquote>\n" ;
print "<H2>$file</H2>\n";
recurse ( $level +1, "$root\\$file");
print "</blockquote>\n" ;
}
else
{
print qq#<LI><A HREF="$root\\$file"
target='DETAILS'>$file</a><BR>\n# ;
}
}
}
exit;
}
When running as a service, I only get the first line "PHFARS log items".
I'm reluctant to submit this, as I'm new to CGI and am not sure if it's not my
fault, but I've searched all over and find no mention of this problem. The
difference between command-line and service performance concerns me.
>How-To-Repeat:
I'm running Perl Win32 (ActiveState). Try it with command-line and again with
service running.
>Fix:
No
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <[EMAIL PROTECTED]> in the Cc line ]
[and leave the subject line UNCHANGED. This is not done]
[automatically because of the potential for mail loops. ]