[OK]Configurer PHP4 sur Apache 1.3.34

Salut à tous,

j’ai installé Apache 1.3.34 et PHP4 sur une testing sur mon LAN:

[quote]malibu:/var/www# apache -v
Server version: Apache/1.3.34 (Debian)
Server built: Jan 6 2006 11:51:34
malibu:/var/www#[/quote]

[quote]malibu:/var/www# ifconfig
eth0 Lien encap:Ethernet HWaddr 00:0D:88:CA:4D:BA
inet adr:192.168.0.1 Bcast:192.168.0.255 Masque:255.255.255.0
adr inet6: fe80::20d:88ff:feca:4dba/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:172952853 errors:0 dropped:0 overruns:0 frame:0
TX packets:140563009 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:623664763 (594.7 MiB) TX bytes:3026362094 (2.8 GiB)
Interruption:11 Adresse de base:0x3000[/quote]
J’ai placé un fichier /var/www/test.php suivant:

[code]malibu:/var/www# cat test.php

<? phpinfo(); ?>

malibu:/var/www#[/code]

Lorsque que je tape 192.168.0.1/test.php dans mon navigateur FF 1.5.0.4, je reçois le message suivant:

[quote]"You have chosen to open
test.php
which is a: PHP file
from: 192.168.0.1
What should Firefox do with this file ?[/quote]
Il me propose ensuite de sauvegarder le fichier ou de l’ouvrir avec un programme de mon choix.

Comment se fait-il que le script ne soit pas exécuté coté serveur ?

Merci

hello,

Faut le déclarer dans le section module puis reloader apache.

Voila ce que j’ai dans mon /etc/apache/httpd.conf:

[code]
LanguagePriority en da nl et fr de el it ja pl pt pt-br lb ca es sv

#
# AddType allows you to tweak mime.types without actually editing
# it, or to make certain files to be certain types.
#
# For example, the PHP 3.x module (not part of the Apache
# distribution - see http://www.php.net) will typically use:
#
#AddType application/x-httpd-php3 .php3
#AddType application/x-httpd-php3-source .phps
#
# And for PHP 4.x, use:
#
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps[/code]

J’ai reloadé apache apreès avoir fait les modifs…

Tu as bien le module php4 pour Apache ?

[quote]16:04 cartman@serveur ~% aptitude show libapache-mod-php4
Paquet : libapache-mod-php4
État: non installé
Version : 4:4.4.2-1.1
Priorité : optionnel
Section : web
Responsable : Debian PHP Maintainers pkg-php-maint@lists.alioth.debian.org
Taille décompressée : 3215k
Dépend: libbz2-1.0, libc6 (>= 2.3.6-6), libcomerr2 (>= 1.33-3), libdb4.3 (>=
4.3.28-1), libexpat1 (>= 1.95.8), libgdbm3, libkrb53 (>= 1.4.2),
libpcre3 (>= 4.5), libssl0.9.8 (>= 0.9.8b-1), libzzip-0-12 (>= 0.12.83), zlib1g (>= 1:1.2.1), debconf (>= 0.5) | debconf-2.0, mime-support (>=
2.03-1), apache-common (>= 1.3.34), php4-common (= 4:4.4.2-1.1),
libmagic1
Suggère: php-pear
Est en conflit: php3
Remplace: php4 (< 4:4.3.8-6)
Fournit: phpapi-20050606
Description : server-side, HTML-embedded scripting language (apache 1.3 module)
This package provides the PHP4 module for the Apache 1.3 webserver (as found in the apache, apache-ssl, and apache-perl packages). To use php4 with Apache
2.0, you probably want libapache2-mod-php4 instead.[/quote]

slt,

Dans httpd.conf :

Include /etc/apache/conf.d

Dans /etc/apache/conf.d/php4.conf

<IfModule mod_php4.c> AddType application/x-httpd-php .php .phtml .php3 AddType application/x-httpd-php-source .phps </IfModule>

Puis un reload.

MERCI ! :smiley:

A qui ?

Dsl Stonfi,

apres avoir installé libapache-mod-php4, tout est rentré dans l’ordre
:wink:

hello,

parfait le principale (j’espere) c’est que tu comprenne :smiley: