Installation manuelle de PHP sous Windows

Choix du serveur Web

IIS

IIS est fourni avec Windows. Sur un serveur Windows, utilisez Server Manager pour ajouter le rôle IIS. Assurez-vous d'inclure la fonctionnalité CGI Role. Sur les bureaux Windows, utilisez le centre de contrôle d'ajout/suppression de programmes pour ajouter IIS. La documentaion de Microsoft a » des instructions détaillées. Pour les applications web bureau et web développement, vous pouvez aussi utiliser IIS/Express ou PHP Bureau

Exemple #1 Ligne de commande pour configurer IIS et PHP


@echo off

REM download .ZIP file of PHP build from http://windows.php.net/downloads/

REM path to directory you decompressed PHP .ZIP file into (no trailing \)
set phppath=c:\php


REM Clear current PHP handlers
%windir%\system32\inetsrv\appcmd clear config /section:system.webServer/fastCGI
REM The following command will generate an error message if PHP is not installed. This can be ignored.
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /-[name='PHP_via_FastCGI']

REM Set up the PHP handler
%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 FastCGI Variables
%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']"

Apache

Il y a plusieurs versions d'Apache2 pour Windows. Nous supportons ApacheLounge, mais d'autres options incluent XAMPP, WampServer et BitNami, qui fournissent des outils d'installation automatique. Vous devriez utiliser mod_php ou mod_fastcgi pour charger PHP dans Apache. Si vous utilisez mod_php, vous DEVEZ utiliser une version TS de Apache, compilé avec la même version de Visual C et le même CPU (x86 ou x64).

Choix de la version

Téléchargez la version de production de PHP pour Windows depuis » http://windows.php.net/download/. Toutes les versions sont optimisées (PGO), et les versions QA et GA sont minutieusement testées.

Il y a 4 types de versions de PHP :

  • Thread-Safe(TS) - utilisé pour des serveurs web n'ayant qu'un seul processus, comme Apache avec mod_php

  • Non-Thread-Safe(NTS) - utilisé pour IIS et les autres serveurs web FastCGI (Apache avec mod_fastcgi) et c'est la version recommandée pour les scripts en ligne de commande

  • x86 - pour système 32-bits.

  • x64 - pour système 64-bits.

add a note add a note

User Contributed Notes 2 notes

up
1
md dot shahin dot hawladar at gmail dot com
2 years ago
when using apache we will add this php8apache2_4.dll module in httpd.config file

example: LoadModule php_module C:/php/php8apache2_4.dll

I extracted php in "C" drive
up
1
klaussantana at gmail dot com
3 years ago
If you're installing PHP 8.0.1 as Apache http server module, in httpd.conf you must use "php_module" in "LoadModule" directive instead of versioned names like in previous versions (aka, php5_module, php7_module, ...). Make the directive as follow:

LoadModule php_module "/path/to/php8apache2_4.dll"

I cracked my head over this...
To Top