PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Newbie Frage



Tomcool
12-04-2002, 20:08
Hi, ich kenne mich mit Perl noch nciht so gut aus. Ich habe Suse 7.3 mit den aktuellen apache. die httpd.conf habe ich soweit auch bearbeitet. und dieses script geht auch:
#!/bin/sh

# disable filename globbing
set -f

echo Content-type: text/plain
echo

echo CGI/1.0 test script report:
echo

echo argc is $#. argv is "$*".
echo
print 'Hallo Du'
echo SERVER_SOFTWARE = $SERVER_SOFTWARE
echo SERVER_NAME = $SERVER_NAME
echo GATEWAY_INTERFACE = $GATEWAY_INTERFACE
echo SERVER_PROTOCOL = $SERVER_PROTOCOL
echo SERVER_PORT = $SERVER_PORT


Frage: wenn ich da oben statt #!/bin/sh #!/usr/bin/perl reinschreibe kommt diese fehlermeldung:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@linux.local and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.



--------------------------------------------------------------------------------

Apache/1.3.23 Server at linux.local Port 80

Diese kommt immer wenn ich ein anderes skript auch ändere. allgemein funktioniert eigentlich kein anderes skript. :-(.
Ich will ja eigentlich nur mit den RRDTOOL was machen. falls das jemand kennt bitte melden. Mfg. Tom

manny
12-04-2002, 21:30
ganz einfach:

dein script ist kein perl-script.

1. der perl interpreter macht da gar nix, weil in der ersten zeile nicht #!/usr/bin/perl steht.

2. Wenn du's reinschreibst, kann der interpreter mit set -f und echo nix anfangen und deshalb bekommst du die fehlermeldung.

- ersetze jedes echo mit print
- vergiss das ; nicht am ende der zeile
- lass set -f und andere unnütze befehle weg

c-ya

Tomcool
13-04-2002, 14:06
OK, gesagt, getan. habe ein skript

#!/usr/bin/perl
print "Hallo Welt!\n";

und was kommt:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@linux.local and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.



--------------------------------------------------------------------------------

Apache/1.3.23 Server at linux.local Port 80



:mad: warum denn das nun wieder?

Tom

Tomcool
13-04-2002, 16:25
und nochwas. in der apache error log steht.

...premature end of script headers...

wd
13-04-2002, 21:02
versuch's mal so:

----------------------------------------------
#!/usr/bin/perl
print "Content-type: text/html\n\n";


print "Hallo Welt!\n";
----------------------------------------------


Du musst dem Perl-Script den Content-type mitgeben.

Tomcool
15-04-2002, 07:16
jo, danke, daran lags.

mfg.
Tom