Category: Internet Information Server

PMB configuration and tunning php.ini PHP

php.ini

PHP Version 5.2.2

System Windows NT  5.2 build 3790

IOF>>

; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.

extension=php_bz2.dll

extension=php_curl.dll

extension=php_gd2.dll

extension=php_mysql.dll

extension=php_soap.dll

extension=php_sockets.dll

extension=php_xsl.dll

extension=php_yaz.dll

extension=php_zip.dll

<<EOF

Office’s MIME types

ile extension File type MIME type
.docx Microsoft Office Word 2007 document application/vnd.openxmlformats-officedocument.wordprocessingml.document
.docm Office Word 2007 macro-enabled document application/vnd.ms-word.document.macroEnabled.12
.dotx Office Word 2007 template application/vnd.openxmlformats-officedocument.wordprocessingml.template
.dotm Office Word 2007 macro-enabled document template application/vnd.ms-word.template.macroEnabled.12
.xlsx Microsoft Office Excel 2007 workbook application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xlsm Office Excel 2007 macro-enabled workbook application/vnd.ms-excel.sheet.macroEnabled.12
.xltx Office Excel 2007 template application/vnd.openxmlformats-officedocument.spreadsheetml.template
.xltm Office Excel 2007 macro-enabled workbook template application/vnd.ms-excel.template.macroEnabled.12
.xlsb Office Excel 2007 binary workbook application/vnd.ms-excel.sheet.binary.macroEnabled.12
.xlam Office Excel 2007 add-in application/vnd.ms-excel.addin.macroEnabled.12
.pptx Microsoft Office PowerPoint 2007 presentation application/vnd.openxmlformats-officedocument.presentationml.presentation
.pptm Office PowerPoint 2007 macro-enabled presentation application/vnd.ms-powerpoint.presentation.macroEnabled.12
.ppsx Office PowerPoint 2007 slide show application/vnd.openxmlformats-officedocument.presentationml.slideshow
.ppsm Office PowerPoint 2007 macro-enabled slide show application/vnd.ms-powerpoint.slideshow.macroEnabled.12
.potx Office PowerPoint 2007 template application/vnd.openxmlformats-officedocument.presentationml.template
.potm Office PowerPoint 2007 macro-enabled presentation template application/vnd.ms-powerpoint.template.macroEnabled.12
.ppam Office PowerPoint 2007 add-in application/vnd.ms-powerpoint.addin.macroEnabled.12
.sldx Office PowerPoint 2007 slide application/vnd.openxmlformats-officedocument.presentationml.slide
.sldm Office PowerPoint 2007 macro-enabled slide application/vnd.ms-powerpoint.slide.macroEnabled.12
.one Microsoft Office OneNote 2007 section application/onenote
.onetoc2 Office OneNote 2007 TOC application/onenote
.onetmp Office OneNote 2007 temporary file application/onenote
.onepkg Office OneNote 2007 package application/onenote
.thmx 2007 Office release theme application/vnd.ms-officetheme

FastCGI 1.5, PHP 5.5.3, IIS 6.0

Machine:

Windows 2003 R2 SP2 English
IIS 6.0
PHP 4.4.4

Components to deploy:
PHP 5.3.3 VC9 x86 Non Thread Safe

Issue:

I always used the ISAPI Moldule from PHP 4, 5 from i can remember, but now PHP says that is not being mainteanced from PHP 5.1 version.

To migrate from PHP 4.4 version is necesary to use FastCGI Handler component to deploy PHP 5.3.3.

I followed these steps, not in order, because i did a lot of installations and uninstallations testing all the components.

After did so many installations, after read so many articles i checked operating system register to locate which terms was related to PHP, php4, php5, php4isapi, php5isapi, etc. I deleted all of them. I needed a clean system so i deleted the garbage.

Then i installed the FastCGI extension from http://www.iis.net/download/FastCGI followed the instructions about http://learn.iis.net/. There was a good article in http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60.

I used the x86 binary file, because i got problems with the WPI the Web Platform Installer of Microsoft. I really want known what i was doing with the server.

I checked the installed files in %windir%\system32\inetsrv:

fcgiconfig.js <- Configuration script
fcgiext.ini <- COnfiguration file
fcgiext.dll <- Handler

Next one was download the binary zip file from http://www.php.net. I downloaded the PHP 5.3.3 VC9 x86 Non Thread Safe. I suppose that there is many versions today.
I unziped files in C:\PHP directory.

Then, i altered the FastCGI settings in php.ini. I followed the instructions from http://www.php.net/manual/en/install.windows.iis6.php

fastcgi.impersonate = 1
fastcgi.logging = 0
cgi.fix_pathinfo = 1
cgi.force_redirect = 0

Next one was configure the FastCGI extension to handle the PHP requests, from the command line i executed...

C:\WINDOWS\system32\inetsrv>cscript fcgiconfig.js -add -section:”php” -extension:php -path:”C:\php\php-cgi.exe”

Then, the system said that i had one entry on Internet Services Manager, Web Service Extensions

I also find a way to re-configuring the FastCGI when you want

C:\WINDOWS\system32\inetsrv>cscript fcgiconfig.js -set -section:”php” -exepath:”C:\php\php-cgi.exe”

Another usefull command if you want be set is how to change the default location of environment vars

C:\WINDOWS\system32\inetsrv>cscript fcgiconfig.js -set -section:”php” -EnvironmentVars:PHPRC:”C:\PHP\”

There is a buch of another command combos to optimice the performance

C:\WINDOWS\system32\inetsrv>cscript fcgiconfig.js -set -section:”PHP” -InstanceMaxRequests:10000
C:\WINDOWS\system32\inetsrv>cscript fcgiconfig.js -set -section:”PHP” -EnvironmentVars:PHP_FCGI_MAX_REQUESTS:10000

If you want to check the changes you may open the configuration file called “fcgiext.ini”.

[Types]
php=PHP

[PHP]
ExePath=C:\php\php-cgi.exe
dInstanceMaxRequests=10000
ActivityTimeout=300
RequestTimeout=600
EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000

I added to the system var path the PHP directory. For check it execute from the command line “set”.

From Internet Information Services manager i checked the Default Web Site properties and checked that in tab Home Settings, section Application Settings,
Application Name: Default Application
Permision: Scripts and Executables
Aplication Pool: DefaultAppPool

Then i pressed configuration button and find that php extension had been added.
.php, C:\WINDOWS\system32\inetsrv\fcgiext.dll, all verbs.

So at this moment i rebooted the operating system and when it started up. I checked a across an url.

This works!

WordPress Themes