Web Hosting Talk







View Full Version : 500 errors on CGI scripts


cpanel-host
11-07-2009, 02:19 AM
Hi all,
Every cgi script I install, I keep getting the 500 internal server error. I have cpanel on my own vps server. The path to perl is /usr/bin/perl. In the cgi scripts the path is #!/usr/bin/perl. I have tried using both paths, and have tried the path !/usr/bin/perl. Still get the internal server error. I have tried using every permission configuration and keep getting the error. I have made sure the first line in the script is the path to perl, and have put the files in the cgi_bin of my website, but nothing works.

Can someone please tell me how to install a cgi script properly. I always use php scripts because I could never get a cgi script to work. I have several cgi scripts on my hard drive that I would like to use, but need someone to tell me the proper way of installing them so I don't keep getting the internal server error.

I have shell access to the server, is there something I need to change on the server itself or is it all in just the scripts settings?

Thank you for your time.

cpanel-host
11-07-2009, 03:05 AM
so why do I get the internal server error?

mattle
11-07-2009, 09:52 AM
Try this:


use CGI::Carp qw/fatalsToBrowser/;


Should tell you what's going wrong. If the script isn't getting far enough to dump an error message to the browser, then check your web server error logs.

Matt

mwatkins
11-07-2009, 01:09 PM
is there something I need to change on the server itself

1. What is showing up in the webserver's error log? This should ALWAYS be your first stop. Paste into the thread a representative error line.

2. Does the script run at all from the command line?

Personally I think people should be banned from using a higher level abstraction (like PHP or like any other web framework) until they can demonstrate they can write and run a simple CGI script.