• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

Keine Anzeige bei -html-Datei

Xaniel

Newbie
Hallo,

habe unter SuSE 9.0 Pro via YaST alles nötige installiert. Zusätzlich Webmin. Alles läuft wunderbar.

Wenn ich eine .php-Datei in einem Browser öffne, dann bekomme ich auch eine korrekte Anzeige (z.B. bei phpinfo();). Wenn ich eine .html-Datei in einem Browser öffne, dann wir PHP anscheinend ignoriert, da hier keine Anzeige stattfindet. Am Code liegt es nicht - habe ich doppelt überprüft!

Habe ich irgendeine Einstellung vergessen?

Gruß, Daniel
 

tux.ICBlood

Member
Hab ich das richtig verstanden? Du versuchst eine .htm Datei zu öffnen die PHP code enthält? Das geht nicht php script müssen immer dei Endungt .php haben.
 
OP
X

Xaniel

Newbie
Nicht direkt - ich habe PHP-Code in die .HTML-Datei eingebettet. Das sieht dann z.B. so aus:


<html>
<head>
<title>Beispiel</title>
</head>
<body>

<?php
echo "Hallo, ich bin ein PHP-Skript!";
?>

</body>
</html>


Das müsste doch angezeigt werden - oder?[/i]
 

imat

Member
Nein, du kannst in .php HTML einbetten. Aber nicht in .html PHP.

Siehe httpd.conf

Code:
    #
    # PHP 3.x:
    #
    <IfModule mod_php3.c>
    AddType application/x-httpd-php3 .php3
    AddType application/x-httpd-php3-source .phps
    AddType application/x-httpd-php3 .phtml
    </IfModule>

    #
    # PHP 4.x:
    #
    <IfModule mod_php4.c>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php-source .phps
    </IfModule>
 
Oben