Hi all. I'm currently learning CGI programming with perl and have built up a webserver using SuSE 9 and Apache 2.0. I'm doing my development work on a windows machine as its a requirement from the lecturer. If I write a perl script on my SuSE machine and put it in CGI bin, it runs fine from my windows browser. If I write a perl script on a windows machine, then copy it onto my Linux server via Samba, then move the script into my cgi-bin folder, I get an error as follows: Server Error! The server encountered an internal error and was unable to complete your request Error message: Premature end of script headers: wintest Error 500 If I rewrite the same script using that file in Linux, I get the same error. I have all the correct attributes set, I have tried dos2unix and am now at a loss. I have also noticed that sometimes the files decide to have a MIME type of text/x-perl and sometimes the are text/html after saving for the first time. I have set 'Content-type: text/html' within all scripts. ?? I'm getting quite worried as I need this running to complete my assignments. Does anyone have any ideas? Thanks, Ged.
ged suse wrote: > I'm currently learning CGI programming with perl and have built up a webserver I would like to learn that too. > If I write a perl script on a windows machine, then copy it onto my Linux > server via Samba, then move the script into my cgi-bin folder, I get an error Finally here is one I can answer. I still consider myself as a novice so many of the questions are beyond me. This is your problem: MS and Linux handle end of line differently, though I don't remember which is which. If you use Samba, the file will not get converted properly. There are two ways I know of to fix the problem 1. use FTP in ASCII mode to transfer the file 2. fix Samba transfered file on Linux side using pico. pico -w yourscript.cgi ctrl +o to save it ctrl +x to exit Hope this helps Damon Register
Hi Damon, Thanks for the reply. This is not the problem. In my orginal email I stated that I ran 'dos2unix' on the file which does the same thing as you suggested. Also as I said, if I go into the file I coppied over and delete all the text then rewite it all (obviously removing all CR/LE imposed in windows) I still get the same problem. Its very strange but I'll have another look into it tonight. Thanks, Ged. On Tuesday 16 March 2004 11:56, Damon Register wrote:
ged suse wrote:
I'm currently learning CGI programming with perl and have built up a webserver
I would like to learn that too.
If I write a perl script on a windows machine, then copy it onto my Linux server via Samba, then move the script into my cgi-bin folder, I get an error
Finally here is one I can answer. I still consider myself as a novice so many of the questions are beyond me. This is your problem: MS and Linux handle end of line differently, though I don't remember which is which. If you use Samba, the file will not get converted properly. There are two ways I know of to fix the problem 1. use FTP in ASCII mode to transfer the file 2. fix Samba transfered file on Linux side using pico.
pico -w yourscript.cgi
ctrl +o to save it
ctrl +x to exit
Hope this helps
Damon Register
ged suse wrote:
This is not the problem. In my orginal email I stated that I ran 'dos2unix' on Sorry I missed that part
Its very strange but I'll have another look into it tonight. Now I am getting curious. Can you e-mail me one of those scripts so I can try it here?
Damon Register
participants (2)
-
Damon Register
-
ged suse