CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
How Do I Run A cgi In Windows?

 



perlkid
stranger

Sep 4, 2000, 10:09 AM

Post #1 of 13 (8917 views)
How Do I Run A cgi In Windows? Can't Post

 
Hi all, How do I run cgi in windows?

I have to get our site up and running on a personal web server on windows 98 by Tuesday September 5. I installed Active State Perl, the latest version, and I have the personal web server running. But I want to run just a hello world program to see If I can get the perl running. I put a script on the personal server and tryied to run it through the browser and when I do it wants to download it and run it in Dos. Frown

How do I need the path to perl?

I have,

#!c:\Perl\bin\Perl
print "Content-type: text/html\n\n";
print "Perl Is On!";
exit;

How Do I get this cgi to run. If I name it to a pl file it runs in dos. Frown

Please Help I don't have a lot of time left.

Thanks,

perlkid


dws
Deleted

Sep 5, 2000, 2:52 PM

Post #2 of 13 (8917 views)
Re: How Do I Run A cgi In Windows? [In reply to] Can't Post

You need to add a registry key to get PWS to recognize .cgi

See http://www.discusware.com/support/resources/windows/perl-pws.html for the correct incantation.


dws
Deleted

Sep 5, 2000, 10:38 PM

Post #3 of 13 (8917 views)
Re: How Do I Run A cgi In Windows? [In reply to] Can't Post

"C:/WebShare" suggests that you're using an older version of PWS (perhaps the one shipped with FrontPage?)

Consider getting a newer copy. I think there's one as an optional install of PWS on the Windows98 CD. It's newer than the FrontPage version.

[This message has been edited by dws (edited 09-06-2000).]


perlkid
stranger

Sep 5, 2000, 10:58 PM

Post #4 of 13 (8917 views)
Re: How Do I Run A cgi In Windows? [In reply to] Can't Post

 
I did install this one from front page 2000, but I upgraded it from a download from microsoft. I think It's the lastest and greatest version but I'll try that anyway.

Thanks,

perlkid


perlkid
stranger

Sep 5, 2000, 10:59 PM

Post #5 of 13 (8917 views)
Re: How Do I Run A cgi In Windows? [In reply to] Can't Post

 
I suppose C:\InetPub is what I should have.


perlkid
stranger

Sep 6, 2000, 1:32 AM

Post #6 of 13 (8917 views)
Re: How Do I Run A cgi In Windows? [In reply to] Can't Post

 
Thanks Dws, But That didn't work for me.

I tried making a regestry key and specifying the path
C:\WebShare\scripts\perl\perl.exe %s
for .pl, and I tried C:\perl\bin\perl.exe %s and other variations.

When I have the key set to use
C:\WebShare\scripts\perl\perl.exe %s
I get an internal server error. But the other ways I get nothing, just sits there, loading.

All I'm using in the .pl file is,

print "Content-Type: text/html\n\n";
print "Perl Is Working\n";

Unless these two lines have something wrong with them then I don't think that an internal server error is related.

I used wordpad to make the pl file too, would that be using a format not suited for perl scripts?

I'm lost with the perl on windows dilema, My partner and I have never had perl running on windows.

I'm pretty tired right now so I may sound like I'm not making any sense, sorry. I've been going at it with apache all day (Crash Course In Hosting To Lan) and I'm pretty tired out.

Thanks For The help Dws.

Can You think of anything else There might be wrong.

Thanks,

perlkid


brian.hayes
User

Sep 7, 2000, 5:54 AM

Post #7 of 13 (8917 views)
Re: How Do I Run A cgi In Windows? [In reply to] Can't Post

You may want to try the .dll that installs with Perl.

C:\Perl\bin\PerlIS.dll
with .pl as the extention.

or

C:\Perl\bin\Perl.exe %s %s
with .pl as the extention

Also, you should not use "Wordpad.exe", try "Notepad.exe".

and then put this in your file.

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


use CGI;
$c = new CGI;
print $c->header;

print "It worked\n";
</pre><HR></BLOCKQUOTE>


dws
Deleted

Sep 7, 2000, 10:09 AM

Post #8 of 13 (8917 views)
Re: How Do I Run A cgi In Windows? [In reply to] Can't Post

Right.


perlkid
stranger

Sep 8, 2000, 11:22 AM

Post #9 of 13 (8917 views)
Re: How Do I Run A cgi In Windows? [In reply to] Can't Post

 
Ok, Thanks Brian,

I'm going to try that tonight when I have time to fiddle with it.

I'll let you know how it works.

Thanks,

perlkid


perlkid
stranger

Sep 8, 2000, 11:18 PM

Post #10 of 13 (8917 views)
Re: How Do I Run A cgi In Windows? [In reply to] Can't Post

 
Ahhhh,

Still Can't Get it to work.

I'm going to uninstall the personal web server and then install a newer version I downloaded from microsoft's site. Then I'll start over step by step.

I'm sure I missed somthing. Smile

Thanks,

perlkid


brian.hayes
User

Sep 13, 2000, 8:06 PM

Post #11 of 13 (8917 views)
Re: How Do I Run A cgi In Windows? [In reply to] Can't Post

O.K, perlkid, the internal server error is directly related to the perl code. That is the error that is returned to the browser.

If you are getting that far you are working, now its just a matter of getting the scripts to work.

I would take a look at your web server errorlog file.


perlkid
stranger

Sep 14, 2000, 10:33 AM

Post #12 of 13 (8917 views)
Re: How Do I Run A cgi In Windows? [In reply to] Can't Post

 
What happend is I never see the 505 error. But while the browser is sitting there loading the cgi, (Never Finishes), I can see that the title of the page in the windows bar down there is titled internal server error.

Not like on the unix based machines where you get a full page, I never see a page on the personal web server. Just sits there.

Does that still aply?

Thanks, I assume it does and I have perl running.

perlkid


brian.hayes
User

Sep 14, 2000, 5:09 PM

Post #13 of 13 (8917 views)
Re: How Do I Run A cgi In Windows? [In reply to] Can't Post

Hmmmm, Actually then this does not apply, ou just simply getting a time out.

Is your mapping to perl.exe using two %s params?

C:\perl\bin\perl.exe %s %s
.pl

Important to have two %s's.

Also when you open your script in the browser can you see a perl.exe process running?
Prease CRTL + ALT + DEL once and the system will show you running processes.

Plus, I would also try the PerlIs.dll

C:\perl\bin\PerlIs.dll
.plx or .pl

Plus look at your errorlog file, it will tell you something to help us out.

Brian Hayes

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives