Microsoft IIS

From FroggDev - En
Jump to: navigation, search


PHP Installation

  • in server management install role CGI
Add CGI role
Add CGI role on windows 2012
  • add PHP in module mapping
PHP mapping
Modify options
  • modify php.ini
fastcgi.impersonate = 1
fastcgi.logging = 0
cgi.force_redirect = 0
  • restart IIS

PHP Configuration

  • if you need COM.php, you need to add the extension (was included in earlier version)
  • allow <? ?> in more than <?php ?>
short_open_tag = On
  • logs path
error_log = "C:\SRVLOG\system\PHP\error.log"
mail.log ="C:\SRVLOG\system\PHP\mail.log"
  • temp files path
session.save_path = "C:\SRVLOG\system\PHP\sessions"
upload_tmp_dir = "C:\SRVLOG\system\PHP\uploads"
  • upload parameters
upload_max_filesize = 2M
post_max_size = 2M
memory_limit = 128M (must be higher than uploads size)
  • enable extensions directory
extension_dir = "ext"

PHP Update

  • stop IIS
  • save php.ini
  • replace old PHP folder for the new one (save the old to rollback if there s trouble)
  • restore php.ini
  • update Visual C++ if needed
  • start IIS


Select add FTP on the IIS server
Add a FTP

Select Name and folder
FTP folder

Set FTP IP and SSL configuration
IP & SSL Configuration

Authorized Users
FTP Users

Add user rights to the physical FTP folder
FTP Users

View result


SMTP role installation

Add role SMTP

SMTP configuration

SMTP configuration

Server IP has to be the same in those 3 cases, "All IP unassigned" allow to work. Do not forget to allow outbound port (25 by default) in firewall

server IP

test in php

if(mail('','test subject','test message','FROM:'))
else	{echo('ERROR');}

change folders


log path


badmail path


drop path

queue & pickup

require adsutil.vbs available in IIS Options

script and tools

Can requier too : IIS6 scripting Tools


adsutil.vbs set smtpsvc/1/dropdirectory C:\SRVLOG\IIS\mail\drop 
adsutil.vbs set smtpsvc/1/badmaildirectory C:\SRVLOG\IIS\mail\badmail 
adsutil.vbs set smtpsvc/1/pickupdirectory C:\SRVLOG\IIS\mail\pickup 
adsutil.vbs set smtpsvc/1/queuedirectory C:\SRVLOG\IIS\mail\queue

Options IIS

Display full errors messages

Error management in IIS

IIS Folders

Move custom error folders

custom errors folders

Change log path


Change temp path

change C:\inetpub\temp\appPools to C:\SRVLOG\IIS\TEMP\appPools (for example), require a system reboot to be taken

REG ADD HKLM\System\CurrentControlSet\Services\WAS\Parameters /v ConfigIsolationPath /t REG_SZ /d C:\SRVLOG\IIS\TEMP\appPools /f

move path C:\inetpub\temp\IIS Temporary Compressed Files: edit the file appPools\{appName}\{appName}.config and change the following line line to desired path

<httpCompression directory="C:\SRVLOG\IIS\TEMP\IIS Temporary Compressed Files">

history path

official doc:

depend on service "Application Host Helper Service"

Application Host Helper Service

it is possible to interact with thoose saves with appcmd.exe which is in c:\system32\inetsrv

  • commands are :
appcmd list backup 			#list of backup available
appcmd add backup [{BackupName}] 	#create a new backup
appcmd delete backup {BackupName} 	#delete a backup
appcmd restore backup {BackupName}	#restore a backup

path can be changed in the file appPools\{appName}\{appName}.config

   <configHistory enabled="true"
      period="00:05:00" />