Microsoft IIS
Contents
PHP on IIS
PHP Installation
- official doc: http://php.net/manual/en/install.windows.iis7.php
- download link: http://windows.php.net/download/
- x64 or x86: architecture in x86 or x64
- VC9 or VC11 or VC(X): visual c++ Version required for same architecture
- VC11 for x86 & x64: http://www.microsoft.com/en-us/download/details.aspx?id=30679
- VC9 for x86: http://www.microsoft.com/en-us/download/details.aspx?id=5582
- VC9 for x64: http://www.microsoft.com/en-us/download/details.aspx?id=15336
- Thread Safe or Non Thread Safe: thread safe is slower, and not really used for the moment
- in server management install role CGI
- add PHP in module mapping
- modify php.ini
fastcgi.impersonate = 1 fastcgi.logging = 0 cgi.fix_pathinfo=1 cgi.force_redirect = 0
- restart IIS
PHP Configuration
- if you need COM.php, you need to add the extension (was included in earlier version)
extension=php_com_dotnet.dll
- 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
- download new version: http://windows.php.net/download/
- 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
FTP
SMTP
SMTP role installation
SMTP configuration
SMTP configuration
Server IP has to be the same in those 3 cases, "All IP unassigned" allow 127.0.0.1 to work. Do not forget to allow outbound port (25 by default) in firewall
test in php
<?PHP
if(mail('admin@frogg.fr','test subject','test message','FROM: test@frogg.fr'))
{echo('OK');}
else {echo('ERROR');}
?>
change folders
log
badmail
drop
queue & pickup
require adsutil.vbs available in IIS Options
Can requier too : IIS6 scripting Tools
commands:
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
IIS Folders
Move custom error 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: http://www.iis.net/configreference/system.applicationhost/confighistory
depend on 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
<system.applicationHost> <configHistory enabled="true" path="%SystemDrive%\inetpub\history" maxHistories="50" period="00:05:00" /> </system.applicationHost>