Question:
Perl or C.G.I. help on webserver?
moofin_poofin
2009-04-10 09:23:50 UTC
when I try to open this file on my webserver, it gives me a 500 error

#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "

Hello World

\n";

How do I run CGI scripts on my server? It's just a hello world test script. I'm new to cgi/perl.
Five answers:
AnalProgrammer
2009-04-10 09:48:20 UTC
Try this link for some hints.



Have fun.
Alexandar
2009-04-10 16:29:14 UTC
Is this on windows or Linux machine? In either case you need to have Perl and a Perl module installed so the web server can understand what the source code is telling it to do.
David D
2009-04-10 16:31:14 UTC
A 500 error just means "Something went wrong". It doesn't give any details, since you don't want to bother the visitors to the website with them.



You need to look in your server's error log to see what the real error is.



http://www.perlmonks.org/?node=CGI%20Help%20Guide#D might be helpful.
S T
2009-04-10 20:29:32 UTC
Most probably, your perl is not at /usr/local/bin/perl



You may try /usr/bin/perl instead
martinthurn
2009-04-13 16:09:26 UTC
You need to read the Idiot's Guide. Whether you take the title personally is up to you.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...