nothing but 500 internal server error with cgi
Posted by: nickmpower
Posted on: 2006-07-04 16:28:00
I have tried using several image upload scripts and i always get the internal server error. I was told that i could just create a folder and it would be cgi enabled. So i created cgi-bin. if anyone could tell me if this is right or why i keep getting the error that would be great. even better if someone could give me a script that works with dreamhost
i placed this script
#!/usr/bin/perl
use strict;
use CGI ":all";
print header(), start_html(), "Hello World", end_html();
into a notepad document and saved it as hello.cgi then uploaded it to nicktenhulzen.com/cgi-bin using smartftp in acsII mode and i get the same server error. i've set the chmod to 755 or 777. so maybe the problem isnt just my uplaod script.
here is the script i edited and below it is how it came
# START USER EDITS
# absolute path to folder files will be uploaded to.
# WINDOWS users, your path would like something like : images\uploads
# UNIX users, your path would like something like : /home/www/images/uploads
# do not end the path with any slashes and if you're on a UNIX serv, make sure
# you CHMOD each folder in the path to 777
$dir = "/uploads";
#$dir = "/uploads";
# absolute URL to folder files will be uploaded to
$folder = "/uploads";
# maximum file size allowed (kilo bytes)
$max = 100000000000;
# for security reasons, enter your domain name.
# this is so uploads may only occur from your domain
# enter any part of your domain name, or leave this
# blank if you don't mind other web sites using your copy
$domain = "http://www.nicktenhulzen.com";
# if a file is successfully uploaded, enter a URL to redirect to.
# leave this blank to have the default message printed. If using
# this var, it must begin with http
$redirect = "http://www.nicktenhulzen.com/uploadsub.htm";
# if you would like to be notified of uploads, enter your email address
# between the SINGLE quotes. leave this blank if you would not like to be notified
$notify = '';
# UNIX users, if you entered a value for $notify, you must also enter your
# server's sendmail path. It usually looks something like : /usr/sbin/sendmail
$send_mail_path = "";
# WINDOWS users, if you entered a value for $notify, you must also enter your
# server's SMTP path. It usually looks something like : mail.servername.com
$smtp_path = "";
# set to 1 if you would like all files in the directory printed to the web page
# after a successful upload (only printed if redirect is off). Set to 0 if you
# do not want filenames printed to web page
$print_contents = 0;
# allow overwrites? 1 = yes, 0 = no (0 will rename file with a number on the end, the
# highest number is the latest file)
$overwrite = 0;
# file types allowed, enter each type on a new line
# Enter the word "ALL" in uppercase, to accept all file types.
@types = qw~
ALL
txt
jpeg
jpg
gif
~;
####################################################################
# END USER EDITS
####################################################################
here it is before i messed with it
# START USER EDITS
# absolute path to folder files will be uploaded to.
# WINDOWS users, your path would like something like : images\uploads
# UNIX users, your path would like something like : /home/www/images/uploads
# do not end the path with any slashes and if you're on a UNIX serv, make sure
# you CHMOD each folder in the path to 777
$dir = "/path/to/demo_uploads";
#$dir = "d:\html\users\html\images";
# absolute URL to folder files will be uploaded to
$folder = "http://www.yourserver.com/demo_uploads";
# maximum file size allowed (kilo bytes)
$max = 100;
# for security reasons, enter your domain name.
# this is so uploads may only occur from your domain
# enter any part of your domain name, or leave this
# blank if you don't mind other web sites using your copy
$domain = "";
# if a file is successfully uploaded, enter a URL to redirect to.
# leave this blank to have the default message printed. If using
# this var, it must begin with http
$redirect = "";
# if you would like to be notified of uploads, enter your email address
# between the SINGLE quotes. leave this blank if you would not like to be notified
$notify = 'you@yourserver.com';
# UNIX users, if you entered a value for $notify, you must also enter your
# server's sendmail path. It usually looks something like : /usr/sbin/sendmail
$send_mail_path = "/usr/sbin/sendmail";
# WINDOWS users, if you entered a value for $notify, you must also enter your
# server's SMTP path. It usually looks something like : mail.servername.com
$smtp_path = "mail.yourserver.com";
# set to 1 if you would like all files in the directory printed to the web page
# after a successful upload (only printed if redirect is off). Set to 0 if you
# do not want filenames printed to web page
$print_contents = 1;
# allow overwrites? 1 = yes, 0 = no (0 will rename file with a number on the end, the
# highest number is the latest file)
$overwrite = 0;
# file types allowed, enter each type on a new line
# Enter the word "ALL" in uppercase, to accept all file types.
@types = qw~
txt
jpeg
jpg
gif
~;
####################################################################
# END USER EDITS
####################################################################Edited by nickmpower on 07/04/06 05:03 PM (server time).