It's useless to try to guess what the error might be, when at the same time an error message can be found in your server's error.log. If you don't have access to the log file, use this line at the top of your CGI script, it might help to get a better error message: