CGI errors

CGI errors

Posted by: mmadison
Posted on: 2006-07-09 19:14:00

I am having trouble getting a basic .cgi file to run. I've uploaded the file to domain.org/cgi-bin/ as mail.cgi, i've changed chmod to 755, but i'm still only getting internal 500 error... do i need to enable cgi somehow?
also, i haven't been able to upload the file using ASCII, i don't know how to override the automatic configurations in Net2FTP

Any help?

Re: CGI errors

Posted by: Atropos7
Posted on: 2006-07-09 23:09:00

Uploading it as binary would be bad if you are on Windows or Mac.

Try http://webftp.dreamhost.com/ instead

Also, given the CGI is Perl script, try

1. Check for compile time errors in shell: perl -c /path/to/script
2. Make sure the shebang line is either #!/usr/bin/perl or #!/usr/local/bin/perl
3. Use a module to most show errors to the browser:

use CGI::Carp qw(fatalsToBrowser);

4. Check the error.log file for your domain



cool Atropos | openvein.org

Re: CGI errors

Posted by: graywolf
Posted on: 2006-07-10 01:43:00

To get the files uploaded in ASCII you need to use an FTP on your computer, something like Cute FTP will do it. I don't think the DH FTP will upload perl without corrupting it

Re: CGI errors

Posted by: norm1037
Posted on: 2006-07-10 02:13:00

To repair the .cgi file you will need to log into your account using SSH with a program like PuTTY.
Once logged in you should run:-
pico -w filename.cgi

Then add a space or character somewhere, say at the end, then remove the same space or character. (This ensures the file is modified).
Now save and exit with:-
control-o (enter)
control-x
and assuming you have created an executable .cgi as mentioned in previous replies the file should run okay.


--
Norm


Opinions are my own views, not DreamHosts'.
I am NOT a DreamHost employee OK!! mad

You act on my advice at your own risk!

Re: CGI errors

Posted by: mmadison
Posted on: 2006-07-10 10:38:00

Thanks all...

after quite a bit of time, i ended up getting my .cgi files to work.

it turns out i couldn't use Net2FTP to upload in ASCII and that was the problem. I had to download an FTP transfer program and specify uploading it in ASCII, then, change the chmod to 755. I used fileZilla.

Thanks again!

Re: CGI errors

Posted by: matttail
Posted on: 2006-07-10 11:12:00

I just used DH's webftp with the Java upload feature to upload a small cgi file. I then changed permissions, and it worked just fine. However, the more standard upload doesn't work correctly - transfering in binary mode.

I'm not sure if this is a misconfiguration of net2ftp install, or what. But as long as you click "java upload" it will work just fine.



--Matttail
art.googlies.net - personal website

Tags: cgi binchmoduploadedasciiuploaddomainorghelp