Script displays in dos window, not browser

J

Joe Burnett

Hello,

I am trying to run a trivial perl script, but the results either get
displayed in a dos window,
or the source code gets displayed in a browser. The former happens when I
open the script
in IE with a pl extension. The latter happens if I open the script with a
cgi extension. Both
scripts reside in "C:\Program Files\Apache Group\Apache2\cgi-bin".
Obviously, I have an
apache server (the service is started, as well as two apache.exe processes).
I have ActiveState
perl installed. Here is the script:

#!C:\Perl\bin\perl.exe

print "Content-type: text/html\n\n";

print "<html>\n<head><title>First CGI</title></head>\n";

print "<body><h1>\n";

print "Hello world!!";

print "</h1>\n </body>\n</html>\n";

I have been looking in the news groups for two days to no avail.

Thanks,

Joe
 
J

Jürgen Exner

Joe said:
I am trying to run a trivial perl script, but the results either get
displayed in a dos window,

Well, then apparently the Perl script works perfectly fine: it prints
exactly what it is supposed to print.
or the source code gets displayed in a browser.
I have an apache server [...]
I have been looking in the news groups for two days to no avail.

Doesn't surprise me. You are looking the wrong place.
You should check out a NG that actually deals with Apache to find out how to
configure Apache.

jue
 
G

Gregory Toomey

Joe Burnett said:
Gregory, thanks for the reply.
Well, off and on for two days. Even if I did know the Apache stuff by heart,
I don't think it would help. I implemented the changes you suggested and the
behavio(u)r did not change. Still get either a DOS window (.pl) or the
source
code displayed in IE (.cgi).

Do you have any other suggestions? Is the fact that I have a Windows XP Pro
as my server, but have specified DHCP to get the IP address (which by the
way
matches the address in my httpd.conf) creating the problem?

Thanks again,

Joe

Step number 1 to to make sure you can access regular html.
eg http://www.yoursite.com/mypage.html
If you can't even do that then you need to sort out DNS issues.

When you have that working you can try something like
http://www.yoursite.com/cgi/bin/script.cgi


gtoomey
 
J

Joe Burnett

Thanks, Alan, Gregory and Jürgen,

I tried your suggestions to no avail on my home based Windows XP system. I
have located a linux based
web server that runs both myscript.cgi and myscript.pl with the expected
results showing up in my browser.
I am able to develope now. I'll get back to my home system later this week.

Thanks again,

Joe Burnett
 
J

Joe Burnett

Thanks, Alan, Gregory and Jürgen,

I tried your suggestions to no avail on my home based Windows XP system. I
have located a linux based
web server that runs both myscript.cgi and myscript.pl with the expected
results showing up in my browser.
I am able to develope now. I'll get back to my home system later this week.

Thanks again,

Joe Burnett
 
J

Joe Burnett

Thanks, Alan, Gregory and Jürgen,

I tried your suggestions to no avail on my home based Windows XP system. I
have located a linux based
web server that runs both myscript.cgi and myscript.pl with the expected
results showing up in my browser.
I am able to develope now. I'll get back to my home system later this week.

Thanks again,

Joe Burnett
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top