PHP funktioniert in der Shell, jedoch nicht im Browser!?

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • PHP funktioniert in der Shell, jedoch nicht im Browser!?

    Hallo zusammen,

    ich habe einen Solaris-Rechner mit Tomcat 4 und PHP 5. Wenn ich mich in der Shell befinde, so funktionieren PHP-Skripte einwandfrei. Sobald ich jedoch im Browser die PHP-Datei aufrufe, so erhalte ich folgende Meldung:
    No input file specified.
    Das PHP-Skript sieht wie folgt aus:
    PHP-Code:
    #!/usr/local/bin/php
    <?php print "Hello world!\n"?>
    Im Logfile vom Tomcat-Server wird mir dabei der folgende Eintrag angezeigt:
    Code:
    2006-03-30 16:40:06 cgi: findCGI: path=/foo.php, /opt/jakarta-tomcat-4.1.24/webapps/VODA/WEB-INF/cgi
    2006-03-30 16:40:06 cgi: findCGI: currentLoc=/opt/jakarta-tomcat-4.1.24/webapps/VODA/WEB-INF/cgi
    2006-03-30 16:40:06 cgi: findCGI: currentLoc=/opt/jakarta-tomcat-4.1.24/webapps/VODA/WEB-INF/cgi
    2006-03-30 16:40:06 cgi: findCGI: FOUND cgi at /opt/jakarta-tomcat-4.1.24/webapps/VODA/WEB-INF/cgi/foo.php
    2006-03-30 16:40:06 cgi: findCGI calc: name=foo.php, path=/opt/jakarta-tomcat-4.1.24/webapps/VODA/WEB-INF/cgi/foo.php, scriptname=/TMS/cgi-bin/foo.php, cginame=/foo.php
    2006-03-30 16:40:06 cgi: runCGI(envp=[{HTTP_USER_AGENT=Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1, HTTP_ACCEPT_ENCODING=gzip,deflate, REQUEST_METHOD=GET, AUTH_TYPE=, HTTP_ACCEPT_LANGUAGE=en-us,en;q=0.5, SERVER_NAME=tms.om.mdv.mmo.de, SERVER_SOFTWARE=TOMCAT, HTTP_ACCEPT_CHARSET=ISO-8859-1,utf-8;q=0.7,*;q=0.7, HTTP_HOST=tms.om.mdv.mmo.de, GATEWAY_INTERFACE=CGI/1.1, X_TOMCAT_SCRIPT_PATH=/opt/jakarta-tomcat-4.1.24/webapps/VODA/WEB-INF/cgi/foo.php, REMOTE_ADDR=139.7.95.84, SERVER_PROTOCOL=HTTP/1.1, PATH_INFO=, REMOTE_HOST=139.7.95.84, QUERY_STRING=, HTTP_CONNECTION=keep-alive, SERVER_PORT=80, CONTENT_TYPE=, HTTP_VIA=1.1 mmoproxy1 (NetCache NetApp/5.6.2R1), 1.1 vtcproxy1 (NetCache NetApp/5.6.2R1), 1.1 vtcproxy6 (NetCache NetApp/5.6.2D13), CONTENT_LENGTH=, HTTP_X_FORWARDED_FOR=139.7.95.74, HTTP_ACCEPT=text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5, SCRIPT_NAME=/TMS/cgi-bin/foo.php, REMOTE_USER=, REMOTE_IDENT=}], command=/opt/jakarta-tomcat-4.1.24/webapps/VODA/WEB-INF/cgi/foo.php)
    2006-03-30 16:40:06 cgi: runCGI: addHeader("Status: 404")
    2006-03-30 16:40:06 cgi: runCGI: addHeader("X-Powered-By: PHP/5.1.2")
    2006-03-30 16:40:06 cgi: runCGI: addHeader("Content-type: text/html")
    2006-03-30 16:40:06 cgi: runCGI: write("No input file specified.
    ")
    2006-03-30 16:40:06 cgi: runCGI: 1 lines received on stderr
    Testweise habe ich auch ein Perl-Skript hinzugefügt und dies lässt sich problemfrei aufrufen im Browser. Hier der Code:
    Code:
    #!/usr/bin/perl
    print
    "Content-type: text/plain\n\n";
    
    print "Hello world\n";
    Im Logfile wird dazu folgendes eingetrage:
    Code:
    2006-03-30 16:26:40 cgi: findCGI: path=/example.pl, /opt/jakarta-tomcat-4.1.24/webapps/VODA/WEB-INF/cgi
    2006-03-30 16:26:40 cgi: findCGI: currentLoc=/opt/jakarta-tomcat-4.1.24/webapps/VODA/WEB-INF/cgi
    2006-03-30 16:26:40 cgi: findCGI: currentLoc=/opt/jakarta-tomcat-4.1.24/webapps/VODA/WEB-INF/cgi
    2006-03-30 16:26:40 cgi: findCGI: FOUND cgi at /opt/jakarta-tomcat-4.1.24/webapps/VODA/WEB-INF/cgi/example.pl
    2006-03-30 16:26:40 cgi: findCGI calc: name=example.pl, path=/opt/jakarta-tomcat-4.1.24/webapps/VODA/WEB-INF/cgi/example.pl, scriptname=/TMS/cgi-bin/example.pl, cginame=/example.pl
    2006-03-30 16:26:40 cgi: runCGI(envp=[{HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1), HTTP_ACCEPT_ENCODING=gzip, deflate, REQUEST_METHOD=GET, AUTH_TYPE=, HTTP_ACCEPT_LANGUAGE=de, SERVER_NAME=tms.om.mdv.mmo.de, SERVER_SOFTWARE=TOMCAT, HTTP_HOST=tms.om.mdv.mmo.de, GATEWAY_INTERFACE=CGI/1.1, X_TOMCAT_SCRIPT_PATH=/opt/jakarta-tomcat-4.1.24/webapps/VODA/WEB-INF/cgi/example.pl, REMOTE_ADDR=139.7.95.84, SERVER_PROTOCOL=HTTP/1.1, PATH_INFO=, REMOTE_HOST=139.7.95.84, QUERY_STRING=, HTTP_CONNECTION=keep-alive, SERVER_PORT=80, HTTP_COOKIE=JSESSIONID=DE5F1B6E04AB8B31B66D22C4E476C229, CONTENT_TYPE=, HTTP_VIA=1.1 mmoproxy2 (NetCache NetApp/5.6.2R1), 1.1 vtcproxy1 (NetCache NetApp/5.6.2R1), 1.1 vtcproxy6 (NetCache NetApp/5.6.2D13), CONTENT_LENGTH=, HTTP_X_FORWARDED_FOR=139.7.95.74, HTTP_ACCEPT=image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*, SCRIPT_NAME=/TMS/cgi-bin/example.pl, REMOTE_USER=, REMOTE_IDENT=}], command=/opt/jakarta-tomcat-4.1.24/webapps/VODA/WEB-INF/cgi/example.pl)
    2006-03-30 16:26:40 cgi: runCGI: 1 lines received on stderr
    2006-03-30 16:26:40 cgi: runCGI: addHeader("Content-type: text/plain")
    2006-03-30 16:26:40 cgi: runCGI: write("Hello world
    ")


    Weiss jemand wie ich nun PHP im Browser zum laufen bekomme? So langsam verzweifle ich.

    Danke und Gruß

  • #2
    Bitte brich deinen Logfileauszug um, so dass man nicht mehr nach rechts scrollen muß!

    http://wiki.apache.org/tomcat/UsingPhp

    Kommentar

    Lädt...
    X