PDA

View Full Version : CGI Errors


ITGEEK
07-01-03, 10:21 PM
We have a customer when creating a form using a cgi script it keeps coming back with an error.

getting an 'Internal Server Error - misconfiguration' message as follows;

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, ****@***.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.



What is wrong? Does it need to be 'Executable'?





Here is an excerpt from a test page of his called p_test_t2.htm;

<HTML>
<HEAD>
<TITLE>p1</TITLE>
</HEAD>
<BODY bgColor=mediumslateblue text=gold>

<P align=center><font size=7><STRONG>Enter</STRONG></font></P>
<DIV align=center>
<form action="cgi-bin/t2.cgi">
<P align=center>
<INPUT type=submit id="b_thank" value="OK" >
</P>
</form></DIV>
</BODY>
</HTML>

Here is the script in cgi-bin called t2.cgi;

#!/usr/bin/perl -w

#use strict;
use Fcntl qw( : DEFAULT :flock );
use DB_File;

#use CGI qw( :standard ), qw( :html3 ) ;
use CGI;


$q = new CGI;

print $q->header,
$q->start_html('CGI page'),
$q->p('hello world'),
$q->end_html;





Any ideas???

Thanks!

UH-Matt
07-01-03, 11:25 PM
Check teh permissions, chances are they are wrong.

Try 755?

beley
07-02-03, 05:12 AM
CGI scripts always have to have execute rights... they're programs - they need to execute (or run) to work.

Chicken
07-02-03, 05:58 AM
Originally posted by ITGEEK:

Here is the script in cgi-bin called t2.cgi;

#!/usr/bin/perl -w
We'll assume this is the path to perl on the server. A few things to check:

Permissions
Path to perl
Upload in ASCII (not binary)
CGI turned on for domain

Some of those are simple checks (like CGI turned on for domain and ASCII), but I've been snagged by those two a couple of times. Drove me nuts until I realized that CGI wasn't even enabled heh!:banghead:

ITGEEK
07-02-03, 11:22 AM
We were thinking about the permissions avenue as well. It definetly is not because CGI is turned off. We enable it on all sites by default (and double checked - just to make sure)


It looks like it may be that it needs to be chmod 755. We will check and make sure that the customer has the permissions set right.

Thanks to everyone!

Chicken
07-02-03, 02:17 PM
Originally posted by ITGEEK:

We were thinking about the permissions avenue as well. It definetly is not because CGI is turned off. We enable it on all sites by default (and double checked - just to make sure)
:D As I mentioned, I only posted that as I almost went :banghead: :crazy: :yikes: :cry: :coffee: :splat: once trying to get a stupid form script to work... until I realized that CGI wasn't enabled for that domain. That form script nearly caused me a nervous breakdown. ::twitch::

Let us know if you get it resolved!

ITGEEK
07-02-03, 03:44 PM
Totally understandable....

We did get it working and it did end up being that the permissions we're wrong. We chmod the file (for our client) to 755 and it worked beautifully....

I really appreciate everybodys feedback! Of course it had to be something simple and over looked...

Thanks again!!!