rmetrich Posted October 12, 2012 Posted October 12, 2012 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";
Byron Posted October 12, 2012 Posted October 12, 2012 Your script works for me. Make sure to chmod your file to 755. If it still doesn't work, refresh your cache. If after that it still doesn't work, post the url to your file.
rmetrich Posted October 12, 2012 Author Posted October 12, 2012 Still doesn't work for me. I verified the permissions.URL is http://gieres.heliohost.org/cgi-bin/test.cgi
Byron Posted October 12, 2012 Posted October 12, 2012 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;
rmetrich Posted October 12, 2012 Author Posted October 12, 2012 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.
Byron Posted October 12, 2012 Posted October 12, 2012 This support request is being escalated to our root admin.
Krydos Posted October 12, 2012 Posted October 12, 2012 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.
Recommended Posts