Windows에서 수동 PHP 설치

웹 서버 선택
IIS

IIS는 Windows에 내장되어 있습니다. Windows Server에서는 서버 관리자를 통해 IIS 역할을 추가할 수 있습니다. CGI 역할 기능이 포함되어야 합니다. Windows 데스크탑에서 IIS는 제어판의 프로그램 추가/제거를 통해 추가되어야 합니다. Microsoft 설명서에는 » 자세한 지침이 있습니다. 데스크탑 웹 앱 및 웹 개발을 위해 IIS/Express 또는 PHP Desktop도 사용할 수 있습니다.

예제 #1 IIS 및 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

Windows용 Apache2에는 여러 빌드가 있습니다. ApacheLounge의 Apache 빌드가 권장되지만 다른 옵션에는 자동 설치 도구를 제공하는 XAMPP, WampServer 및 BitNami가 있습니다. PHP는 mod_php 또는 mod_fastcgi를 통해 Apache에서 사용할 수 있습니다. mod_php는 동일한 버전의 Visual C와 동일한 CPU(x86 또는 x64)로 빌드된 Apache의 TS 빌드가 필요합니다.

빌드 선택

Windows 빌드는 » http://windows.php.net/download/에서 다운로드할 수 있습니다. 모든 빌드가 최적화(PGO)되고 QA 및 GA 릴리스가 철저히 테스트됩니다.

PHP 빌드에는 4가지 유형이 있습니다.

  • Thread-Safe(TS) - mod_php가 있는 Apache와 같은 단일 프로세스 웹 서버용
  • Non-Thread-Safe(NTS) - IIS 및 기타 FastCGI 웹 서버(mod_fastcgi가 있는 Apache) 및 명령줄 스크립트에 권장
  • x86 - 32비트 시스템용.
  • x64 - 64비트 시스템용.