downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Étapes pour une installation manuelle> <L'installeur Windows (PHP version 5.1.0 et inférieures)
[edit] Last updated: Mon, 20 May 2013

view this page in

Installeur Windows (PHP 5.2 et suivant)

L'installeur PHP pour Windows pour les versions suivantes de PHP est construit en utilisant la technologie MSI via le kit d'outils Wix (» http://wix.sourceforge.net/). Il installe et configure PHP ainsi que toutes les extensions internes et PECL, mais aussi, configure les serveurs web les plus populaires comme IIS, Apache, et Xitami.

Tout d'abord, installez votre serveur HTTP (web) sur votre système et assurez-vous qu'il fonctionne correctement. Puis, utilisez l'un des types d'installation de PHP suivants.

Installation normale

Exécutez l'installeur MSI et suivez les instructions fournies par l'assistant d'installation. Il vous sera demandé de sélectionner le serveur Web que vous voulez configurer en premier, ainsi que tous les détails de configuration nécessaires.

Ensuite, il vous sera demandé de sélectionner quelles fonctionnalités et extensions vous voulez installer et activer. En sélectionnant "Will be installed on local hard drive" dans le menu pour chaque élément, vous pouvez contrôler l'installation ou non de la fonctionnalité. En sélectionnant "Entire feature will be installed on local hard drive", vous pourrez installer toutes les sous-fonctionnalités de la fonctionnalité principale (par exemple, en sélectionnant la fonctionnalité "PDO", vous installerez également tous les drivers PDO).

Avertissement

Il n'est pas recommandé d'installer toutes les extensions par défaut, sachant que la plupart nécessite des dépendances externes à PHP afin de fonctionner correctement. Préférez l'utilisation du mode de réparation qui est accessible via le panneau de contrôle "Ajout/Suppression de programmes" pour activer ou désactiver les extensions ou fonctionnalités, après l'installation.

L'installeur configurera donc PHP pour l'utiliser sous Windows, le fichier php.ini ainsi que certains serveurs Web. L'installeur configure actuellement IIS, Apache, Xitami et Sambar ; si vous utilisez un serveur web différent de ceux-ci, vous devrez le configurer manuellement.

Installation silencieuse

L'installeur supporte également un mode silencieux, qui est utile pour les administrateurs systèmes pour déployer PHP facilement. Pour utiliser le mode silencieux, entrez la commande suivante :

msiexec.exe /i php-VERSION-win32-install.msi /q

Vous pouvez contrôler le dossier d'installation en le passant comme paramètre à l'installeur. Par exemple, pour installer PHP dans le dossier e:\php :

msiexec.exe /i php-VERSION-win32-install.msi /q INSTALLDIR=e:\php
Vous pouvez également utiliser la même syntaxe pour spécifier le dossier de configuration d'Apache (APACHEDIR), le dossier du serveur Sambar (SAMBARDIR), et le dossier du serveur Xitami (XITAMIDIR).

Vous pouvez également spécifier quelles fonctionnalités devront être installées. Par exemple, pour installer l'extension mysqli et l'exécutable CGI :

msiexec.exe /i php-VERSION-win32-install.msi /q ADDLOCAL=cgi,ext_php_mysqli

Voici la liste courante des fonctionnalités à installer :

MainExecutable - exécutable php.exe
ScriptExecutable - exécutable php-win.exe ( N'est plus disponible depuis PHP 5.2.10/5.3.0; il est maintenant inclut par défaut )
ext_php_* - les diverses extensions ( par exemple : ext_php_mysql for MySQL )
apache13 - module Apache 1.3
apache20 - module Apache 2.0
apache22 - module Apache 2.2
apacheCGI - exécutable Apache CGI
iis4ISAPI - module IIS ISAPI
iis4CGI - exécutable IIS CGI
iis4FastCGI - exécutable IIS CGI
NSAPI - module serveur Sun/iPlanet/Netscape
netserve - exécutable NetServe Web Server CGI
Xitami - exécutable Xitami CGI
Sambar - module Sambar Server ISAPI
CGI - exécutable php-cgi.exe
PEAR - installeur PEAR
Manual - manuel PHP au format CHM

Pour plus d'informations sur l'installation via les installeurs MSI depuis la ligne de commande, visitez » http://msdn.microsoft.com/en-us/library/aa367988.aspx

Mise à jour de PHP avec l'installeur

Pour effectuer une mise à jour, exécutez l'installeur soit en mode graphique, soit en ligne de commande. L'installeur lira vos options d'installation, effacera votre ancienne installation et réinstallera PHP avec les mêmes options que précédemment. Il est recommandé d'utiliser cette méthode pour mettre à jour votre installation de PHP plutôt que d'aller remplacer manuellement les fichiers dans le dossier d'installation.



add a note add a note User Contributed Notes Installeur Windows (PHP 5.2 et suivant) - [10 notes]
up
5
Anonymous
4 years ago
I just installed PHP 5.2.8 (MSI package) on windows XP, IIS 5.1.

Selected IIS-ISAPI, always got error "The specified module could not be found." (firefox), HTTP 500 Internal Server Error (ie 7). Even though no extensions were selected.

Trick: Install PHP to C:\PHP (and not to C:\Program Files\PHP)

In your IIS web site properties, tab home directory, configuration, application mappings.
Remove the quotes before and after the executable path and the problem will be solved.
up
2
peter at peterjhart dot com
3 years ago
Apache2 on Windows (PHP 5.3.1):

Install VC6 x86 THREAD SAFE. If you do not see Apache in the list of webservers, it is because you downloaded the NON-THREAD SAFE installer.
up
0
fawaz at webcitynetworks dot com
3 years ago
Tryed installing PHP several times using the MSI instalation, which defaults to "C:\Prorame Files\PHP", and could not work at all.

The OS: Windows XP, with SP3
Web Server: IIS 5.1

Instalation Steps:

Step 1: Install the MSI Instalation, but make sure you select the instalation folder to be "C:\PHP" and NOT "C:\Programe Files\PHP\".

Step 2: Copy the "php.ini" fil from "C:\PHP", to "C:\Windows\" folder. Keep the default settings, so far OK.

Step 3: Go to IIS, Open "Default Website", Properties, and open the "Home Directory" tab, and then "Configue" buttton.

Step 4: Click 'Add" under Mappings Tab, and browse for "C:\PHP\php-cgi.exe" file from 'Browse', and add ".php" (i.e. without the Qoutes ""). Keep "Verb" settings to "All Verbs" and click "OK"

Step 5: Create a php file with : <?php phpinfo();?>, and test.

It should be working fine by this time.

Hope this was helpful to all.
up
-2
ckelley at ca-cycleworks dot com
1 year ago
Two aspects of a typical Windows installation:

1) The default behavior for short_open_tag is OFF. You must edit php.ini and explicitly set it to ON. This means most developers will have their source code displayed rather than the script executed. short_open_tag OFF means the php tags must be <?php  ?> and the shorter <? ?> will not be interpreted.

2) When using php as cli from the command line, Windows 7 will perform the file association in such a way that running a script from the command line will not accept additional arguments. Note, however that typing the full path to the executable will see arguments. As Windows 7 has a limited file associations GUI, the fix is to open regedit and change the key HKEY_CLASSES_ROOT\Applications\php.exe\shell\open\command from its default value of "C:\php\php.exe" "%1" to instead read "C:\php\php.exe" "%1" "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9"
up
-1
manville at doctors dot org dot uk
3 years ago
I have just spent a tiresome morning trying to get PHP 5.2 / 5.3 installed onto Apache 2.2 (WinXPSP2) (Slight oddity in setup that program files on D: drive)

I have finally got it to work by using the following:

1) Getting installation script to use "Other CGI" (would be nice if it mentioned Apache - I believe it to be a fairly popular option)

2) Adding the following directives to httpd.conf (the Apache configuration file)

ScriptAlias /php/  "D:/Program Files/PHP/"

(This tells Apache to treat the PHP directory as script files/executables and alias it under /php/ for ease of use later)

AddHandler x-httpd-php .php

(This tells apache to recognise all .php files as of type x-httpd-php (equally you could call them anything you liked and after this mornings debacle I can think of one or two choice phrases)

Action x-httpd-php "php/php-cgi.exe"

(The tells Apache to use php-cgi.exe to handle files of type x-httpd-php (or .php files as we declared earlier). php-cgi.exe only exists if you have selected the "Other CGI" option at installation". A lot of stuff around on the web is pointing at php.exe which is now failing. Has this changed recently?)
up
-2
infoworld at yahoo dot com
4 years ago
Using the installer, I have been getting the "cannot run script" error on Windows XP and IIS 5.1.  I used both the Zip file and installer filer to make it successful:

1. I downloaded the zip file (not the installer) into C:\php\,
2. extracted the contents to the same directory (C:\php\).
3. Downloaded and ran the installer into the C:\php\

Nagesh A
up
-1
rod at rodsdot dot com
3 years ago
On IIS 5.1 (Windows XP) and IIS 6.0 (Windows Server 2003) the following installation method goes very smoothly, but for three additional tasks.

Before installing PHP 5.2.x using the Microsoft Web Platform Installer, make sure:

C:\PHP does not exist
C:\Program Files\PHP does not exist (it will be created)
C:\Windows\php.ini does not exist (you won't need it there)

Run Microsoft Web Platform Installer allowing it to install FastCGI support and PHP 5.2.x.

After installation you should have PHP installed in C:\Program Files\PHP.

An examination of php.ini will show you will not likely need to change any settings, except the sendmail_from address.  The Windows specific settings have been set, but are grouped together under:

; Default timeout for socket based streams (seconds)

Those are:
upload_tmp_dir="C:\WINDOWS\Temp"
session.save_path="C:\WINDOWS\Temp"
error_log="C:\WINDOWS\temp\php-errors.log"
cgi.force_redirect=0
fastcgi.impersonate=1
fastcgi.logging=0

In addition to having the correct minimal IIS settings already set in php.ini, you will find the Path has had C:\Program Files\PHP\ added, and the environment variable PHPRC is set correctly.

The three things not performed by the install but needed to run:

1.
HKEY_LOCAL_MACHINE\Software\PHP\IniFilePath may be wrong.  It should not be C:\Windows, but C:\Program Files\PHP, which is what is set in both the PATH and PHPRC. (This could be a left over setting from a previous install, but the installer does not correct it.)

2.
In IIS manager, under the default web site properties, Home Directory (tab), Configuration (button), Mappings, the entry for .php may be missing or wrong. It should be:
Executable: "C:\Program Files\PHP\php-cgi.exe" with the quotes.
Verbs: Limit To: GET,HEAD,POST,TRACE
Script Engine checkbox checked
Check That File Exists checkbox checked.

3.
The installer will not set the proper security permissions for php-cgi.exe or php.ini, both of which need to be accessible to the default Internet user account: e.g. IUSR_machine name.

In Windows Explorer, navigate to the C:\Program Files\PHP folder, right click, properties, security (tab), add IUSR_machinename and accept the default security permissions.

All of these seemed to take effect without a reboot, but a reboot is suggested.  Note: Items 1 and 2 may be left over from previous installations and might possibly be rightly ignored by the installer, but if they are not corrected (at least check) you are going to have a problem.

Item 3 is not going to be performed by the installer.  You will have to do it based on how you have security permissions set in IIS.
up
-3
lwpro2
2 years ago
run php as CGI binary, and add these to httpd.conf,

#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
ScriptAlias /php/ "C:/php/"
Action application/x-httpd-php "C:/php/php-cgi.exe"
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml

<Directory "C:/Apache2.2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

<Directory "C:/php">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

finally it works
up
-1
jasonma84 at yahoo dot com
24 days ago
I think a lot of people are turned away from using PHP because it is such a nightmare to install. I install Apache/PHP and it never works.

With todays technology, is there not an installer that just works for PHP and Apache together? There are so many versions/binaries but how about publishing one that just works.

I've been developing in PHP for over 10 years now and yes I still have issues trying to get this to install on a new machine. It usually takes me about 4-5 hours every time even though it should only be a couple of steps to get it to work.
up
-4
jstein at image dot dk
4 years ago
I just installed PHP 5.2.8 as an ISAPI-extension for IIS 6 in Windows 2003 server.

I used the Windows installer, but had to make a few changes manually:

- Copy php.ini from the PHP folder (C:\Program Files\PHP) to the Windows folder (C:\Windows).

- Enable the ISAPI extension. (In IIS Manager under "Web Service Extensions" add a new extension with "Required files" set to C:\Program Files\PHP\php5isapi.dll).

- Add index.php to default index pages (select properties for "Web Sites", add it on the "Documents" tab).

 
show source | credits | sitemap | contact | advertising | mirror sites