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?)
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).
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 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 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.
Installeur Windows (PHP 5.2 et suivant)
21-Jul-2009 01:50
19-May-2009 10:41
Looks like IIS ISAPI option is missing from php-5.2.9-2-win32-installer.msi
12-Feb-2009 09:41
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
09-Jan-2009 03:06
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.
30-Dec-2008 10:33
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).
