Installation avec IIS pour Windows

Installer IIS

Les Services d'informations Internet (Internet Information Services - IIS) sont intĂ©grĂ©s Ă  Windows. Sur Windows Server, le rĂŽle IIS peut ĂȘtre ajoutĂ© via le Gestionnaire de serveur. La fonctionnalitĂ© de rĂŽle CGI doit ĂȘtre incluse. Sur les bureaux Windows, IIS doit ĂȘtre ajoutĂ© via l'option Ajout/Suppression de programmes du Panneau de configuration. La documentation Microsoft fournit » des instructions dĂ©taillĂ©es pour activer IIS. Pour le dĂ©veloppement, » IIS/Express peut Ă©galement ĂȘtre utilisĂ©.

Note: La version Non-Thread Safe (NTS) de PHP doit ĂȘtre installĂ©e lors de l'utilisation du gestionnaire FastCGI avec IIS.

Configurer PHP avec IIS

Dans le gestionnaire IIS, installer le module FastCGI et ajouter un mappage de gestionnaire pour .php au chemin de php-cgi.exe (pas php.exe)

La commande APPCMD peut ĂȘtre utilisĂ©e pour scripter la configuration IIS.

Exemple de script batch

Exemple #1 Ligne de commande pour configurer IIS et PHP


@echo off

REM télécharger le fichier .ZIP de la version de PHP depuis http://windows.php.net/downloads/

REM chemin du répertoire dans lequel le fichier .ZIP de PHP a été décompressé (sans \ final)
set phppath=c:\php


REM Efface les gestionnaires PHP actuels
%windir%\system32\inetsrv\appcmd clear config /section:system.webServer/fastCGI
REM La commande suivante gĂ©nĂ©rera un message d'erreur si PHP n'est pas installĂ©. Cela peut ĂȘtre ignorĂ©.
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /-[name='PHP_via_FastCGI']

REM Configure le gestionnaire PHP
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/fastCGI /+[fullPath='%phppath%\php-cgi.exe']
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /+[name='PHP_via_FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='%phppath%\php-cgi.exe',resourceType='Unspecified']
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /accessPolicy:Read,Script

REM Configure les variables FastCGI
%windir%\system32\inetsrv\appcmd set config -section:system.webServer/fastCgi /[fullPath='%phppath%\php-cgi.exe'].instanceMaxRequests:10000
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi /+"[fullPath='%phppath%\php-cgi.exe'].environmentVariables.[name='PHP_FCGI_MAX_REQUESTS',value='10000']"
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi /+"[fullPath='%phppath%\php-cgi.exe'].environmentVariables.[name='PHPRC',value='%phppath%\php.ini']"
add a note

User Contributed Notes

There are no user contributed notes for this page.