Re: XP messing up my CGI files
by atcroft (Abbot) on Aug 06, 2002 at 03:37 UTC
|
You didn't leave as much to go on as you possibly thought, but here is an idea or two that might be helpful, if in the debugging process.
First of all, what kind of server are you uploading to? Is it another Windows-based system (NT, 2K, XP, etc.), or a *nix system (linux, solaris, *bsd, etc.)? What error message are you actually seeing when you try to execute the script? I'm not convinced that it is strictly because of XP that you are having the difficulties, unless there are other symptoms that you have not mentioned.
Since you seem to indicate that all you did was save the content down to your local machine then re-uploaded it, could it possibly be that when the file is being uploaded, the line endings are not being translated from the Windows \n\r to the appropriate ending? I am unfamiliar with the editors you mentioned-do they have settings for saving text files with the appropriate line endings?
Just a few thoughts that I hope help.
Update: I ran across CGI Help Guide in the Tutorials section, which might also be useful.
| [reply] |
|
|
I have no idea, Im just uploading to a site with FTP and I get a 500 error. Im using notpad now, I had no problem on Windoes 98.
| [reply] |
Re: XP messing up my CGI files
by grep (Monsignor) on Aug 06, 2002 at 03:38 UTC
|
Please give as much information as you can when you ask a question.
Things like:
- what OS are you transferring the file to.
- How you are transferring the file
- what is the exact error message you get from the log file when you get your 500 error (this is very important)
will really help us help you
I will make some assumptions and try to help you
- I assume you are developing on your WinXP box.
- I assume you are transferring your file to *nix
- I assume you are transferring the file via FTP
You may have a problem with your line endings. Make sure you transfer using ASCII mode and FTP will handle the line ending conversion for you (when you need conversion Mac <-> M$ <-> *nix)
grep
|
Just me, the boy and these two monks, no questions asked. |
| [reply] |
|
|
ASCII made file size smaller, but still get 500 error
| [reply] |
|
|
- What is the exact error message you get from the log file when you get your 500 error (this is very important)
grep
|
Just me, the boy and these two monks, no questions asked. |
| [reply] |
|
|
what is the error you get in the error log
maybe try adding use CGI::Carp qw/fatalsToBrowswer/; if you for some reason cant access the error log
| [reply] |
Re: XP messing up my CGI files
by strat (Canon) on Aug 06, 2002 at 10:56 UTC
|
Maybe the following might help you finding out the error:
BEGIN {
print "Content-type: text/html\n\n";
}
This tries to send a content-type as early as possible. In combination with use CGI::Carp qw(fatalsToBrowser); you might find out better information about the problem.
Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32" | [reply] [d/l] [select] |
Re: XP messing up my CGI files
by jsprat (Curate) on Aug 06, 2002 at 06:05 UTC
|
Probably not a perl or an XP problem, but one of two things - your FTP client is transferring the files in binary mode (like others say above) or you need to chmod the file so it can be executed. Your FTP client is probably capable of doing both.Detailed instructions (plus many other CGI troubleshooting tips _if_ my guess is wrong) can be found here or either of the links atcroft mentioned above. | [reply] [d/l] |
Re: XP messing up my CGI files
by Anonymous Monk on Aug 06, 2002 at 04:36 UTC
|
| [reply] |
|
|
Premature end of script headers: /home/sdstaff/public_html/topsites/index.cgi
This is the important part. What you most likely have is a warning message before you print your headers. Run the script from the command line of the server it is going to run on. This will almost certainly illuminate your problem
My guess, since you say it runs on the XP box, is a missing module
grep
|
Just me, the boy and these two monks, no questions asked. |
| [reply] |