Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cgi script works on Net Firms host, but local linux host can't read it

Status
Not open for further replies.

random260

Programmer
Mar 11, 2002
116
US
I have a cgi script that I wrote that works just ducky on the Net Firms web hosting site. I placed the script on our local server (a Linux box running Apache) and it acts like it can't even read it. I know cgi is working on the local server - I wrote a small "hello world" script USING THE TEXT EDITOR ON THE LINUX SERVER, and it worked fine. I wrote THE SAME EXACT "HELLO WORLD" SCRIPT on a Windows machine and FTPed it to the Linux box, and even the "hello world" script won't work (uploaded the same Windows "hello world" file to the Net Firms server, and it worked fine). I have tried writing the "hello world" script in Notepad, and in Wordpad (saving it in every text style I could, trying each one) and it just won't work. There must be some freaky codes or something that the windows text editor is putting in that the Linux box no-likey. I did notice that the difference betweent the "hello world" I wrote on the Windows box and the "hello world" I wrote on the Linux box is (when viewed with Notepad) is that the Windows one looks "normal", and the Linux one is all on one line, with the Carraige Returns being represented by little black squares (kinda like in Unicode text). Is there a Linux or Perl or Apache module somewhere that is not loaded on the Linux web server box or something? Or what IS the problem? I would apreciate any help.
Thanks.
 
This problem was solved for me by a user in the cgi forum. The thread for any interested is thread452-333510
 
I read the above thread in the CGI forum.

The reason that this is happening is because you are probably transmitting the files via FTP in ASCII mode. Whenever you upload via FTP, make sure to transfer in Binary mode.

Also, I have found problems with text files written in Windows Notepad, and then uploaded using FTP to a Linux box. I use Wordpad (Windows) and vi (Linux) and transfer in binary mode and don't have any problems with text files anymore.


ChrisP ------------------------------------------------------------------------------
If somebody helps you, please click the link in the botton left hand corner that says "Mark this post as a helpful/expert post".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top