Installation d'Apache puis de P.H.P. sous Windows.

Pour commencer il faudra vous procuer le fichier « apache_1_3_6_win32.exe »
Il se trouve sur apache.org ou encore sur de nombreuses revues informatiques.

Je suppose que tous les éléments réseau sont installés.

Lancer l'installation.d'Apache.

Ensuite il vous faut éditer le fichier
C:\Program Files\Apache Group\Apache\conf\httpd.conf

Il vous reste à modifier ce passage :

#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and this will make redirections work in a sensible way.
#
#ServerName new.host.name

De la manière suivante :


#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and this will make redirections work in a sensible way.
#
#ServerName new.host.name
ServerName 126.0.0.1

En rouge vous indiquerez l'adresse I.P. de votre machine

Ensuite lancer Apache puis votre navigateur habituelle
Indiquez dans la barre d'adresse : http://126.0.0.1
Si tout c'est bien passé vous devriez voir la page intitulé :
« It Worked! The Apache Web Server is Installed on this Web Site! »

Notes :
D'autres paramètres du fichier de configuration peuvent être modifié.


Maintenant nous allons pouvoir installer php3
Comme d'habitude tout d'abord il faudra vous le procurer sur php.net
Copier les fichiers dans le répertoire
« C:\Program Files\Apache Group\Apache\cgi-bin »
Pour la suite nous allons modifier certains paragraphes du fichier
« C:\Program Files\Apache Group\Apache\conf\httpd.conf »
Le même qu'au chapitre précédent.
Trouver le paragraphe suivant :

#
# AddType allows you to tweak mime.types without actually editing it, or to
# make certain files to be certain types.
#
# For example, the PHP3 module (not part of the Apache distribution)
# will typically use:
#
#AddType application/x-httpd-php3 .phtml
#AddType application/x-httpd-php3-source .phps

Nous allons le modifier de cette manière :

#
# AddType allows you to tweak mime.types without actually editing it, or to
# make certain files to be certain types.
#
# For example, the PHP3 module (not part of the Apache distribution)
# will typically use:
#
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3 .phtml

On vérifiera l'exactitude de ce paragraphe.

#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/"

Pour finir on modifiera :

#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#

de la manière suivante :

#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
Action application/x-httpd-php3 "/cgi-bin/php.exe"

Il ne vous reste plus qu'à tester le résultat sur un fichier .php3

Enjoy !!

Compléments sur davidubois.free.fr
ainsi que sur
Foire Aux Questions de fr.comp.infosystemes.www.auteurs.php
et en anglais sur le service de référence du PHP php.net
encore ?
Configurer PHP3 pour apache sur Windows NT
PHP3 Installation Guide for Windows rev 0.5 (en anglais)
Tutoriel pour débutant (en français)
phpindex.com (en français, site dédié au php).

Menu ressources
Revenir au sommaire.
CopyRight 2000 Anamorphose