View Full Version : Internal Server Error - Why not a USEFUL error message??
INurv 05-07-2002, 10:17 PM I am having some troubles installing a cgi program.. I've followed all directions for chmoding and such but the 5th step gives me an Internal Server Error, is there any way to find out what the error actually was?? It seems like putting a meaningless error is rather stupid.. shouldn't it give you some information as to what went wrong instead of just returning nothing? I've checked error_log and access_log, and no information regarding the problem was there, could it possibly be in another log?
Thanks for any help
Ben
Techark 05-07-2002, 10:26 PM -wt after the perl sha bang. But first confirm the path to perl is right for your server. Like this #!/usr/bin/perl -wT and then run the script, then view the error log and it should have a bit more info in it's last lines.
Hope that helps. A 500 error can be casued by many things. Is this a commercial script one that you know works or is at least supposed to work or is this one you have written and modified?
Monte Roberts
INurv 05-07-2002, 10:33 PM It's a commercial script - and the funny thing it is works on my server (this is on someone else's server). I'll try what you said, thanks.
ffeingol 05-07-2002, 10:57 PM Normally those types of errors will go to the error_log.
If you can, just try running the script for a command prompt (i.e. telnet/ssh). If it's a perl path problem or include problem, that will usually show up quite quicly that way.
Frank
INurv 05-07-2002, 11:52 PM The paths were fine, but that -wT trick did work.. it did start to show the whole error (a TON of them in this case) in error_log. The script only gives the 500 error when i am at step 5 of the installation, which includes POST data so i can't just call the script like:
perl script.cgi
Unforunately my friend thinks this is a Perl problem, but it is clearly a problem with the script. Other perl scripts run fine and I can pull stuff through perl -e fine.
Thanks for the help,
Ben
allera 05-08-2002, 12:00 AM I don't know if this is a factor or not, but if the server has suexec installed and running, make sure you meet its requirements (permissions, ownerships, etc).
By the way, what is the 5th step? It's not chmod 777 is it? :)
Techark 05-08-2002, 12:44 AM T on there. That turns on taint mode which all scripts should have on while running but for better debug turn it off.
There is a nice little script called adminpro.cgi http://www.craigrichards.com/software/ that will check paths and scripts for you.. BUT whatever you do DONOT leave it on the server it is a big security risk.
Good luck if you need anymore help you can email the errors and I will try and help you dechiper them.
Monte Roberts.
chuckt101 05-13-2002, 09:03 PM tip: Make sure you uploaded the text files in ASCII. ;)
Shyne 05-14-2002, 12:22 AM If you have suexec installed look in the suexec_log
Website Rob 05-14-2002, 03:43 AM Once you know you have the correct shebang add a blank line and the following immediately after it:
use CGI::Carp "fatalsToBrowser";
Should help to make some sense of any DIE errors.
Edit: since you are already having problems I thought I'd also mention (if the above doesn't work) you can use the same line a bit differently:
use CGI::Carp qw(fatalsToBrowser);
Wazeh 05-14-2002, 11:01 PM Inurv, I would check for two things:
1) open the script in vi and check to see that
#!/usr/bin/perl
is the first line (no empty lines above it) and also the # is the
first character on the line (no spaces or anything before it).
2) If you have edited the script on your PC to configure some variables for your use, your PC adds a "return" before each new line. So when you open the file with vi, you may notice a lot of characters like this ^M
If you see those, you need to remove them. A simple way is using
this set of commands:
tr -d '\r' <script >script.tmp
mv script.tmp script
chmod 755 script
and give it a try. Hope this helps.
|