Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi I was wondering if anyone might be able to help me. I've recently set-up a Redhat Linux 9 server and installed apache. I'm doing some work in Perl and have successfully got scripts to work and tested with Mozilla.
The trouble I'm having is that I have some sites I've already created on an XP machine (sorry) and want to transfer them over. I FTP the files across (ASCII not binary transfer) and make sure they have the correct permissions but I get a 500 error - premature end of scripts. It's wierd because you copy the code and paste into a new file on the Red Hat server and it works fine. So I can only assume the permissions or something are getting messed up when they come across from XP?
If anyone could suggest any ways I could debug apache further or look at what might be wrong with the file permissions/ownership further I'd love to know,
I did the same thing as you and was getting the exact same error. I put a "-w" on the #!/usr/bin/perl line to display any warnings and instead of displaying warnings, all my scripts work with the "-w" added. It doesn't make any sense.
Thanks for the reply. The only other thing I would suggest checking when moving from XP to Redhat is making sure that the editor in XP you have been using has "Unix Line Endings" turned on.
Originally posted by bsdb3 Hi I was wondering if anyone might be able to help me. I've recently set-up a Redhat Linux 9 server and installed apache. I'm doing some work in Perl and have successfully got scripts to work and tested with Mozilla.
The trouble I'm having is that I have some sites I've already created on an XP machine (sorry) and want to transfer them over. I FTP the files across (ASCII not binary transfer) and make sure they have the correct permissions but I get a 500 error - premature end of scripts. It's wierd because you copy the code and paste into a new file on the Red Hat server and it works fine. So I can only assume the permissions or something are getting messed up when they come across from XP?
If anyone could suggest any ways I could debug apache further or look at what might be wrong with the file permissions/ownership further I'd love to know,
cheers,
David
Hi bsdb3,
this problem happend by your ftp.
you need to edit vsftpd.conf
I'm still getting this problem and I'm not transfering files via FTP. I have tried creating the script from scratch on the Linux server and copying the script from my Windows machine to the Linux machine via Samba. I always get the premature end of script headers message unless I add -w to the Perl line at the top. When I do that, the scripts run fine.
Update: Someone in another thread solved my problem. The problem was that each line of my script had a <CR> after it. This does not show up with the GEdit text editor I was using on my Linux server, but when I switched to the Nedit text editor, it showed the <CR>'s on each line. I deleted them all and removed the -w from the perl line at the top and the script ran fine!
Update #2: I found that even Nedit doesn't always show the ctrl-m characters, but if you open the file with Nedit then do a save as and save it with the same name as Unix format, it will remove the ctrl-m's that are causing the premature end of script headers error message.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.