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 Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI basics

Status
Not open for further replies.

theom

Programmer
Feb 22, 2001
28
NL
Hi,
I am starting my first (unstable) steps in the wonderful world of CGI, but it ain't easy...

To start with I have the following problem. On a Windows 98 computer I have installed Perl and a (small) webserver. Calling an executable from a CGI script works fine (e.g. <
However, when I try to call a Perl program, I can't get it to work. What is the exact syntax for doing this? I have tried < < test.pl>, but nothing works.
 
What Webserver are you using..

can you execute .pl scripts form the /cgi-bin dir setup in your webserver config?

does you script start with the #!somepath/perl line?

What does your browser return when you run the script?

what is in the errorlog of your webserver?

Hope these questions help point you in some direction closer to your problem.

Cheers
AcidHawk
----
Of All the things I've lost in my life it's my mind I miss the most.
 
First: sorry for the late reply (work, work, work ...)

Webserver: SimpleServer: AnalogX. Nothing to configure, no error-logs.

I have a cgi-bin dir, and perl scripts are running from here.

When using an executable in the same manner (e.g. a search engine, als from AnalogX), everything works fine: a HTML page is returned with the search results.

With the perl script I get the standard download window from Microsoft:

Downloading a file: what to do:
- Save this program to disk
- Run this program from its current location.

So it can find the file, but it doesn’t execute it. (???)

The test.htm looks like this:

Click <a href=&quot; to test this script.



The test.pl looks like this:

#! c:/perl/bin/perl

print &quot;content-type: text/html\r\n\r\n&quot;;
print &quot;Hello!&quot;
#

Perl d:\cgi-bin\test.pl works fine from a DOS window.
 
Sorry mate I know nothing about SimpleServer:: tried your code on Apache 1.3.20 and IIS5 and It worked on both.

No Logs does seem wierd though..:)

Hope you find help soon!

Rgds
AcidHawk ----
Of All the things I've lost in my life it's my mind I miss the most.
 
theom,

I had a similar with the Save file to Disk message on my IIS server in W2K. My problem turned out to be that I hadn't given the directory the correct rights to execute/run scripts from the directory where I had my perl scripts.
Don't know if this helps at all...

AussieClint
 
It sounds like perl is not installed properlly. If PERL is installed properlly on a windows server you should have the location of the PERL compiler in the autoexec.bat file. I suggest trying to reintall PERL.

Also try changing the extension on the script to watever.cgi
and see if that makes a difference.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top