www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norman Lorrain <lorr...@sedsystems.ca>
Subject os-windows/1792: Command line / service differences (Service fails to run CGI correctly)
Date Thu, 12 Feb 1998 14:43:49 GMT

>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
>Originator:     lorrain@sedsystems.ca
>Release:        1.3b3
NT 4.0, SP3
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_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" ;

				print qq#<LI><A HREF="$root\\$file" 				

target='DETAILS'>$file</a><BR>\n# ;



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.
I'm running Perl Win32 (ActiveState).  Try it with command-line and again with service running.
[In order for any reply to be added to the PR database, ]
[you need to include <apbugs@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]

View raw message