Skip to content

Instantly share code, notes, and snippets.

@gcormier
Created April 1, 2017 20:49
Show Gist options
  • Save gcormier/360eb2660d79fdcd387b41879137cc4d to your computer and use it in GitHub Desktop.
Save gcormier/360eb2660d79fdcd387b41879137cc4d to your computer and use it in GitHub Desktop.
Setup PHP on Windows Server 2016 / IIS 10
REM PHP Folder, no trailing backslash at the end!
SET PHP_FOLDER=C:\tools\php71
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/fastCgi /+[fullPath='%PHP_FOLDER%\php-cgi.exe']
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /+[name='PHPviaFastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='%PHP_FOLDER%\php-cgi.exe',resourceType='Either']
%windir%\system32\inetsrv\appcmd set config -section:system.webServer/fastCgi /[fullPath='%PHP_FOLDER%\php-cgi.exe'].instanceMaxRequests:10000
%windir%\system32\inetsrv\appcmd set config -section:system.webServer/fastCgi /+[fullPath='%PHP_FOLDER%\php-cgi.exe'].environmentVariables.[name='PHP_FCGI_MAX_REQUESTS',value='10000']
echo "<?php phpinfo(); ?>" > C:\inetpub\wwwroot\info.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment