Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Perl/CGI Script

Internal Server Error



7:07 pm on Jan 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member


I'm trying to link to a file, fileA.cgi, which is in the cgi-bin directory in a folder called chap01- from fileA.html.

When I press on a link in fileA.html, I get an Internal Server Error. Just to test it out I created another cgi file called fileB.cgi in the same folder. When I link to it from the same .html page I get the results of the cgi file.

Both .cgi scripts are set to CHMOD 755 and were uploaded as an ASCII. All I did was change the filename in the link, so how come one works and the other doesn't?

I checked for errors using the command line...syntax was OK. I also checked to make sure I could output the .cgi file in question using the command line and everything was fine. I just can't do it from the browser.

Any help is greatly appreciated.



2:58 pm on Jan 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

A puzzler. Are both scripts identical, and set to the same user / group?


6:52 am on Feb 10, 2004 (gmt 0)

10+ Year Member


I am really new to CGI and Perl and also to VI.

Can u tell me what command shall I use on VI to execute the file. I tried sh filename but it gives the error that it cannot recognise the print command.

Please help



1:46 am on Feb 13, 2004 (gmt 0)

10+ Year Member

Hi. Here's a guess on your problem.

I had a similar problem the other day. A file that had been working for a long time suddenly stopped working, right after I uploaded and overwrote it. The error log said "fopen permission denied" or something like that, so it wasn't a syntax problem.

To make a long story short, my FTP client was telling me that it was set to have execute permissions, but it didn't really have execute permissions. I refreshed a number of times, and it still showed that it had execute permissions, but it really didn't.

Here's what I'd do if I were you: Place the following in your Perl code, at the very start of your code (at the very start of where you actually start issuing commands)

die "somethingunique";

Upload it to your server, and execute the script.
Then check your error log and see if it mentions "somethingunique".

If it doesn't, then it means that it hasn't even made it to the first command/expression/statement. In that case, it's probably a file permissions thing.

Hope that helps,


Featured Threads

Hot Threads This Week

Hot Threads This Month