Manuelle PHP-Installation auf Windows

Web-Server auswählen

IIS

Der IIS ist in Windows eingebaut. Auf Windows Server kann die IIS-Rolle über den Server-Manager hinzugefügt werden. Das CGI-Rollen-Feature muss enthalten sein. Auf Windows-Desktop muss der IIS über die Systemsteuerung unter Software hinzugefügt werden. In der Microsoft-Dokumentation finden Sie eine » ausführliche Anleitung. Für Desktop-Webanwendungen und Web-Entwicklung kann auch IIS/Express oder PHP Desktop verwendet werden.

Beispiel #1 Kommandozeilen-Konfiguration von IIS und PHP


@echo off

REM Zip-Datei des PHP-Builds von http://windows.php.net/downloads/ herunterladen
REM Pfad des Ordners in den die PHP-Zip-Datei entpackt wurde (ohne abschließendes \)
set phppath=c:\php


REM Löschen der aktuellen PHP-Handler
%windir%\system32\inetsrv\appcmd clear config /section:system.webServer/fastCGI
REM Das folgende Kommando erzeugt eine Fehlermeldung, wenn PHP nicht installiert ist. Dies kann ignoriert werden.
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /-[name='PHP_via_FastCGI']

REM Aufsetzen der 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 Konfiguration der FastCGI-Variablen
%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

Es gibt mehrere Builds von Apache2 für Windows. Empfohlen werden die Apache-Builds von ApacheLounge, aber es gibt auch andere Optionen wie XAMPP, WampServer und BitNami, die automatische Installationsprogramme zur Verfügung stellen. PHP kann mit dem Apache über mod_php oder mod_fastcgi verwendet werden. mod_php erfordert ein TS-Build von Apache, der mit derselben Version von Visual C und derselben CPU (x86 oder x64) kompiliert wurde.

Build auswählen

Windows-Builds könnenn von » http://windows.php.net/download/ heruntergeladen werden. Alle Builds sind optimiert (PGO), und QA- und GA-Versionen sind gründlich getestet.

Es gibt 4 Arten von PHP-Builds:

  • Thread-Safe(TS) - für Einzelprozess-Webserver, wie Apache mit mod_php

  • Non-Thread-Safe(NTS) - für IIS und andere FastCGI-Webserver (Apache mit mod_fastcgi) und empfohlen für Befehlszeilen-Skripte

  • x86 - für 32-Bit-Systeme

  • x64 - für 64-Bit-Systeme

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