Download-Fenster PHP und Apache

Alles, was den Apache betrifft, kann hier besprochen werden.

Download-Fenster PHP und Apache

Postby argonist » 14. November 2007 12:59

Hallo,

wenn ich url mit index.php aufrufe, wird es Download-Fenster erscheint, dass index.php heruntergeladen wird. Das wollte ich nicht.

Ich habe PHP mit neues Version schon installiert und Konfigurationsdatei von Apache eingetragt.

Error_log von Apache
Code: Select all
[Tue Nov 13 09:19:13 2007] [notice] Apache/2.2.6 (Linux/SUSE) mod_ssl/2.2.6 OpenSSL/0.9.8a PHP/5.2.5 mod_perl/2.0.2 Perl/v5.8.8 configured -- resuming normal operations


php5.conf
Code: Select all
<IfModule mod_php5.c>
        AddType application/x-httpd-php5 .php .php4 .php5 -phtml
        AddType application/x-httpd-php5-source .phps
        AddHandler application/x-httpd-php5 .php4
        AddHandler application/x-httpd-php5 .php5
        AddHandler application/x-httpd-php5 .php
        AddHandler application/x-httpd-php5-source .php4s
        AddHandler application/x-httpd-php5-source .php5s
        AddHandler application/x-httpd-php5-source .phps
        DirectoryIndex index.php4
        DirectoryIndex index.php5
        DirectoryIndex index.php
</IfModule>
VirtuelleHost


<VirtualHost 10.8.0.1:80>
    ServerAdmin manuel.ostendorf@ponte-web.de
    ServerName zabbix.ponte-home.de

    DocumentRoot /srv/www/vhosts/ponte-home.de/zabbix

    HostnameLookups Off
    UseCanonicalName Off
    ServerSignature On

    Include /etc/apache2/conf.d/php5.conf

    <Directory "/srv/www/vhosts/ponte-home.de/zabbix">
          AddHandler php5-script php
          Options +Indexes +FollowSymLinks
          DirectoryIndex index.php
          AllowOverride None
          Order allow,deny
          Allow from all
    </Directory>

</VirtualHost>


Habt ihr irgendwie mein Fehler erkennt?

Manu[/code]
argonist
 
Posts: 9
Joined: 23. April 2007 14:44

Postby Wiedmann » 14. November 2007 19:42

Code: Select all
<IfModule mod_php5.c>
        AddType application/x-httpd-php5 .php .php4 .php5 -phtml
        AddType application/x-httpd-php5-source .phps
        AddHandler application/x-httpd-php5 .php4
        AddHandler application/x-httpd-php5 .php5
        AddHandler application/x-httpd-php5 .php
        AddHandler application/x-httpd-php5-source .php4s
        AddHandler application/x-httpd-php5-source .php5s
        AddHandler application/x-httpd-php5-source .phps
        DirectoryIndex index.php4
        DirectoryIndex index.php5
        DirectoryIndex index.php

Entweder du arbeitest mit Handlern, oder mit Typen. Oder halte dich einfach ans PHP-Manual:
Code: Select all
<IfModule php5_module>
    AddType application/x-httpd-php .php .php4 .php5 .phtml
    AddType application/x-httpd-php-source .phps .php4s .php5s
    DirectoryIndex index.php index.php4 index.php5
</IfModule>

(BTW: Wenn du hier den DirectoryIndex überschreibst, geht natürlich "index.html" nicht mehr. Und im Dorectory Block unten, überschriebt du diesen.)

Code: Select all
<Directory "/srv/www/vhosts/ponte-home.de/zabbix">
          AddHandler php5-script php

Diese Zeile mit AddHandler muss natürlich rausfliegen.

Code: Select all
<Directory "/srv/www/vhosts/ponte-home.de/zabbix">
          DirectoryIndex index.php

Entweder du fügst oben die "index.php" zum DirectoryIndex hinzu und lässt diese Zeile weg, oder du musst hier die *.php* Endungen hinufügen.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby argonist » 15. November 2007 01:05

Wiedmann, so habe ich geändert, wie du beschrieben hast. Leider ist das Problem immer noch gleich. :( Wenn ich das Befehl auf Konsole "php -f index.php" mache, dann funktioniert das. Das Problem liegt bestimmt bei Apache

Manu
argonist
 
Posts: 9
Joined: 23. April 2007 14:44

Postby argonist » 21. November 2007 20:02

Hallo,

Habt ihr irgdwie Idee für das?

Manu
argonist
 
Posts: 9
Joined: 23. April 2007 14:44


Return to Apache

Who is online

Users browsing this forum: No registered users and 131 guests