Which error log do you think it'll be in? Are we talking apache error logs, or something else? How would I write my own debug message, as soon the program gets to the login phase it just dies.
Just had a thought.. Does apache block CGI scripts from using certain ports? Although the first connection line is working so it should have already connected to the host before it logs on? I really have no idea what to do.