CGI errors



I am having trouble getting a basic .cgi file to run. I’ve uploaded the file to 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?


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

Try 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: [color=#6600CC]Atropos[/color] |


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


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)
and assuming you have created an executable .cgi as mentioned in previous replies the file should run okay.


Opinions are my own views, not DreamHosts’.
I am NOT a DreamHost employee OK!! :@

You act on my advice at your own risk!


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!


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 - personal website