Premature end of script headers (für Fortgeschrittene)

Alles, was Perl betrifft, kann hier besprochen werden.

Premature end of script headers (für Fortgeschrittene)

Postby tosho » 17. October 2009 22:39

Hallo zusammen.

Ich bin am Ende meines Lateins. Mein Webserver (Apache unter Linux) weigert sich standhaft perlscripte auszuführen.
Was immer ich auch tue. Das Ergebnis ist immer "premature end of script headers"
Auf meinem lokalen System (auch Apache unter Linux) funktioniert's problemlos.


Das Script ist recht überschaubar:
$cat test.pl

#!/usr/bin/perl
print "Content-Type: text/html\n\n";
print "Hello World.\n";

Zeilenumbrüche sind auch OK:
$ hd test.pl
00000000 23 21 2f 75 73 72 2f 62 69 6e 2f 70 65 72 6c 20 |#!/usr/bin/perl |
00000010 0a 70 72 69 6e 74 20 22 43 6f 6e 74 65 6e 74 2d |.print "Content-|
00000020 54 79 70 65 3a 20 74 65 78 74 2f 68 74 6d 6c 5c |Type: text/html\|
00000030 6e 5c 6e 22 3b 0a 70 72 69 6e 74 20 22 48 65 6c |n\n";.print "Hel|
00000040 6c 6f 20 57 6f 72 6c 64 2e 5c 6e 22 3b 0a |lo World.\n";.|
0000004e

Berechtigungen auch:
$ ls -l
-rwxr-xr-x 1 user www-data 78 Oct 17 23:15 test.pl

Habe ich vielleicht ein Problem mit meinem Apache/perl?
Was kann ich noch tun?

Hiiilfe!!!
tosho
 
Posts: 2
Joined: 17. October 2009 22:28

Re: Premature end of script headers (english version)

Postby tosho » 17. October 2009 23:04

I am not sure if this forum is english or german. So here the same message in english)

Hi.

I don't know where to look further with this error. My webserver (Apache under Linux) refuses to play any perl script.
Whatever I try I always get a "premature end of script headers"

On my local system (also Apache under Linux) it works perfectly.


The script is pretty simple:
$cat test.pl

#!/usr/bin/perl
print "Content-Type: text/html\n\n";
print "Hello World.\n";

Line feeds are linux type:
$ hd test.pl
00000000 23 21 2f 75 73 72 2f 62 69 6e 2f 70 65 72 6c 20 |#!/usr/bin/perl |
00000010 0a 70 72 69 6e 74 20 22 43 6f 6e 74 65 6e 74 2d |.print "Content-|
00000020 54 79 70 65 3a 20 74 65 78 74 2f 68 74 6d 6c 5c |Type: text/html\|
00000030 6e 5c 6e 22 3b 0a 70 72 69 6e 74 20 22 48 65 6c |n\n";.print "Hel|
00000040 6c 6f 20 57 6f 72 6c 64 2e 5c 6e 22 3b 0a |lo World.\n";.|
0000004e

Rights are also OK:
$ ls -l
-rwxr-xr-x 1 user www-data 78 Oct 17 23:15 test.pl

Maybe ther is a problem with my Apache/perl installation??
Please tell me where to go from here. I haven't got any clue?

BTW. Normal pages are served without any problem.

Please help!!!
tosho
 
Posts: 2
Joined: 17. October 2009 22:28

Re: Premature end of script headers (für Fortgeschrittene)

Postby Nobbie » 21. October 2009 12:26

Vielleicht gibt es ja gar kein /usr/bin/perl - hast Du das gecheckt?
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04


Return to Perl

Who is online

Users browsing this forum: No registered users and 8 guests