Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem getting Perl script to run on IIS 5

Status
Not open for further replies.

michellerobbins56

Programmer
Jan 10, 2006
89
GB
Hi

I have looked in many resources for the last few days and done exactly as I'm supposed to to enable a .pl (Perl) script to run and execute on IIS (by going into the Configuration section under Home Directory tab of the website in IIS. However I keep getting a Page cannot be found 404 error.

I have tested the syntax of the Perl scrip in the CMD prompt by typing the following:
C:\> perl -c D:\AWStats\cgi-bin\test.pl

And it says the syntax is OK.

How can I enable Perl to run?

Thank you very much for any help into this problem.
 
By the way I have checked and double checked all the permissions many times and everything are as they should be.

Basically I am trying to get AWStats web log file analyser to work. This looks very good but I first need my IIS to be able to run Perl scripts to enable this.

I have Perl (from ActiveState) fully installed, all necessary modules etc. Still no luck - keep getting the 404 error.

Thanks again for any help at all.
 
Also, one thing to mention but can anyone tell me if this makes a difference:
the Perl.exe and other files installed form ActiveState all reside in
C:\Perl\bin

Whereas my website documents all reside in:
D:\AWStats\cgi-bin

Should they be in the same drive - i.e the C: drive or does it not make a difference? I didn't think it did as my website references the Perl.exe file in the Configuration section correctly in the C:drive, even though the actual website itself is in the D:drive.

 
What is the 1st line in your script?

Thats where it should point to c:\perl\bin.

What happens if you run the script by itself at the command line?
 
Hi thanks for your reply. The first line of the script does point to C:\perl\bin\perl.exe

Here is the basic test.pl script:

#!c:\perl\bin\perl.exe
# ^^^ this must be the first line of the script! ^^^
# start code

use strict;
use CGI;
my $q = new CGI;

# print header and start the markup output

print $q->header( "text/html" ),$q->start_html( "hello from perl cgi!" );
print $q->h2("hello Michelle...");
print $q->end_html;
# end code

The script runs properly from the command prompt, outputting the text.

Thanks for any help.
 
Does it matter that the script 'test.pl' in my "AWStats" website directory is on my D: drive and the perl.exe file is on the C:drive?

What else could cause this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top