Yet another CGI problem

Status
Not open for further replies.

jjjjjj

New Member
Messages
1
Reaction score
0
Points
0
Hi all,

I have a sample CGI introduction script that I copied from a textbook (uhn.x10hosting.com/cgi-bin/cgitest2.cgi). It has 0755 permission and it's in /public_html/cgi-bin, yet I still get a 500 Internal Server error. Heck, even the scripts that I got from the CGI center from CPanel (like the randhtml one) don't work.

Edit: I forgot to mention that I tried the Simple CGI Wrapper, moved the cgi files to scgi-bin and it still doesn't work.

Thanks in advance for the help.

Here's the code for the CGITest2.cgi (though it's probably irrelevant)

#!/usr/bin/perl -wT

use strict;

my $time = localtime;
my $remote_id = $ENV{REMOTE_HOST} || $ENV{REMOTE_ADDR};
my $admin_email = $ENV{SERVER_ADMIN};

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

print <<END_OF_PAGE;
<HTML>
<HEAD>
<TITLE>Welcome to Mike's Mechanics Database</TITLE>
</HEAD>

<BODY BGCOLOR="#ffffff">
<IMG SRC="/images/mike.jpg" ALT="Mike's Mechanics">
<P>Welcome from $remote_host! What will you find here? You'll
find a list of mechanics from around the country and the type of
service to expect -- based on user input and suggestions.</P>
<P>What are you waiting for? Click <A HREF="/cgi/list.cgi">here</A>
to continue.</P>
<HR>
<P>The current time on this server is: $time.</P>
<P>If you find any problems with this site or have any suggestions,
please email <A HREF="mailto:$admin_email">$admin_email</A>.</P>
</BODY>
</HTML>
END_OF_PAGE
 
Last edited:

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
[root@absolut cgi-bin]# perl cgitest2.cgi
"-T" is on the #! line, it must also be used on the command line at cgitest2.cgi line 1.
 
Status
Not open for further replies.
Top