Jump to content

[Solved] Internal Error 500 When Trying To Setup A Simple Cgi Perl Script


rmetrich

Recommended Posts

Hello,

I registered for a free account yesterday for evaluation. My website has been deployed since a couple of hours.

Trying to test the cgi feature using a perl script, I always get Internal Error 500 even if I'm sure my script is okay.

 

Question: where should I put the script? cgi-bin or scgi-bin? The Cpanel installation wizard says scgi-bin.

 

Wherever I place it, I then always get error 500.

 

Script is as follows:

#!/usr/bin/perl
BEGIN {
   my $b__dir = (-d '/home/rmetrich/perl'?'/home/rmetrich/perl' getpwuid($>) )[7].'/perl');
   unshift @INC,$b__dir.'5/lib/perl5',$b__dir.'5/lib/perl5/x86_64-linux',map { $b__dir . $_ } @INC;
}
print "Content-type: text/html\n\n";
print "<html><head></head><body>\n";
print "HELLO THERE\n";
print "</body></html>\n";

Link to comment
Share on other sites

You haven't edited your .htaccess file in anyway have you?

 

Try this simple script and see if it works:

 

#!/usr/bin/perl -w
use CGI ':standard';
$current_time = localtime;
print header,
start_html('A Virtual Clock'),
h1('A Virtual Clock'),
"The current time is $current_time - PST.",
hr,
end_html;

Link to comment
Share on other sites

It doesn't work either.

I didn't modify the .htaccess in public_html/.

It contains the following:

# -FrontPage-
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName gieres.heliohost.org
AuthUserFile /home/rmetrich/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/rmetrich/public_html/_vti_pvt/service.grp

 

By the way, my pure html test file works (http://gieres.heliohost.org/index.html). It's an empty html file with just a title.

Link to comment
Share on other sites

It's working now http://gieres.helioh...gi-bin/test.cgi The problem wasn't syntax or anything like that. The problem was he already had about 8 perl processes running for hours so everything, including php scripts, would have given a 500 error. I killed his processes and now it works. Make sure your scripts terminate properly and this won't happen again.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...