PDA

View Full Version : Non-functional Cgi-bin



Jeremy
07-15-2004, 08:35 PM
Hey folks,

I cannot get even the simples shell script to execute:

#!/bin/sh
echo content-type: text/plain
echo
date

(I'm debugging - I'm obviously not trying to get a web page to report the date out)

Anyway - this simple script is in my cgi-bin directory, has 777 permissions, and the directory has the default 755 permissions, and the file was uploaded in ASCII mode. My user stats says I have PHP and CGI-BIN access - and while PHP works fine, I can't get perl or even the above shell script to work.

When executing this script I get a 500 Internal Server Error. My logs report premature end of script headers.

Ok so any ideas? I have some clue - really I do - but I spent about 2 hours trying to figure out what the heck I was doing wrong here.

Joe
07-15-2004, 10:31 PM
scripts should be chmod 755....


The following paths are commonly needed by scripts.



Path to perl: /usr/bin/perl

Path to sendmail: /usr/sbin/sendmail



CGI URL: http://www.yourdomain.com/cgi-bin/script.cgi

Subdomain CGI URL: http://subdomain.yourdomain.com/cgi-bin/script.cgi



Path to cgi-bin: /home/username/domains/domain.com/public_html/cgi-bin

Path to cgi-bin (subdomain): /home/username/domains/domain.com/public_html/subdomain/cgi-bin

Jeremy
07-16-2004, 12:27 PM
Thanks Joe...

>scripts should be chmod 755....

I tried everything - I put it at 777 just to eliminate any permission problem when 755 didn't work on an earlier script - a script that apparently did have issues.

Because now at 755 my simple script above works.

Wow feel pretty dumb now :)