Perl CGI: Cannot be displayed

Can you tell me why I can't get a simple Perl5 CGI program that is placed in the cgi-bin directory of my Personal Web Server to work. I have installed Perl5. Incidentally, the CGI script has a standard windows default icon and is just called "CGI File" - is it set up correctly? I have the cgi-lib.pl file placed in this directory too with a yellow icon (i.e. it's recognised as a perl file). Although the simple CGI doesn't use this file. If I rename the .CGI to .PL then it tries to download. Normally it comes up with HTTP 500 Internal Server Error - problem with page you are trying to reach.

I have a feeling it's somethingto do with the first line:

#!/usr/local/bin/perl

as the file has been placed in "wwwroot/cgi-bin".

Hope you can help.
LVL 1
rhinosaurAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rhinosaurAuthor Commented:
Edited text of question.
0
s_stirleyCommented:
The first line is to pass the script to the perl program. You need to change it to something like
#!/wwwroot/cgi-bin/perl.exe
though this may not work if it's on a different drive ..
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jhurstCommented:
I doubt that the problem is that first line.  The line does need to be the address of the perl interpretter, that is true, but if you can make the thing execute other ways then the line must be right.  Check that you can execute it.

The check that the script really does the Content-type: header and all the required <html>, etc.
0
merryhillsCommented:
1. Check that perl executable is in /usr/bin/perl

2. Check that the permisiions of the cgi script are correct, it needs to allow execution,
eg chmod 755 script.cgi

3. Check with your ISP that you have permission set in the web server to run cgi scripts in your directory, only the administrator can do this. If you are running an apache web server you need to edit the .httpconf file. Near the end of this file it allows you to specify the access permissions for directories running cgi-scripts

4. Check the administrator error logs, usually found in /var/log/httpd.error, they tell you whats going on.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.