php on windows - what's new
DESCRIPTION
Talk by Josh Holmes of Microsoft at ZendCon 2009TRANSCRIPT
PHP on WindowsWhat’s New
By Josh Holmes
2
Agenda
BackgroundWhat’s NewMicrosoft and Open Source
Technologies
3
History - (prior to 2006)
•PHP on Windows was: Slow Unreliable Not Compatible
•IIS support for PHP was a joke: CGI implementation was SLOW ISAPI implementation was unreliable
•Thread-safe dependency never would have worked anyway
No URL rewriting support
4
History - (2006-2008)
•FastCGI support for IIS 7.0, 6.0, 5.11: Finally a fast and reliable way to run PHP on Windows •SQL Driver for PHP Reliable, scalable integration with Microsoft SQL
Server Development continues•URL Rewrite in IIS 7.0‣Fully features and performant URL rewriting engine
Pigs fly !
5
Present (2009 --> )
Microsoft Employees Submit to PHP Core Microsoft Employees Submit to Open Source PHP
Application• Wordpress
PHP included in the “Microsoft Web Platform” PHP applications included in the Windows Web
Application Gallery WinCache extension for PHP ships
More Pigs Fly
6
PHP Installer
Configures IIS FastCGI on all Windows Versions
Sets the recommended PP configuration directives
Adds index.php as a default document in IIS configuration
On Windows - IIS FastCGI becomes the default
7
PHP is part of the Microsoft Web Platform
9
PHP in the Microsoft Web Platform Installer
Drives the standard PHP Installer
Downloads the installer from http://windows.php.net
Always the latest 5.2.x release
PHP 5.3 will be offered soon• But not yet ?
Technical Details
10
PHP Applications in the Web PI
12
PHP Apps in the Microsoft Web PI
Applications are hosted on their own web sites.
The package includes a manifest file that tells the Web PI what to do:
• Copy Files• Set file access permissions• Create a database user• Create a database schema• Launch the application’s install page.
Technical Details
13
WinCache Extension for PHP
15
WinCache for PHP
Caches PHP opcode and file content in shared memory
API’s for refreshing the cache and for cache stats
Supports PHP 5.2.X and PHP 5.3.
Technical Details
16
Microsoft and Open Source Community
Legal barrios being removed. Working with the PHP Community
• Windows Specific Testing and Bug Fixes• PHP Installer Fixes• Testing PHP Release Packages
Working with PHP App Communities• PHP Apps in the Microsoft Web App Gallery (Add Yours !) • IIS Specific Fixes Submitted to WordPress• IIS Specific fixes submitted to SilverStripe
New Open Source Foundation
Hell Freezing Over ?
PHP on Windows Progress
• The Windows version of PHP now exposes a set of constants prefixed PHP_WINDOWS_*. A list of these constants and their usage can be found at http://docs.php.net/manual/en/info.constants.php
• Warning Support for the ISAPI module has been dropped. Use the improved FastCGI SAPI module instead.
• Note: A new dedicated site for PHP on Windows is now available, including downloads, release candidates, and snapshots in various flavors (thread-safe/not-thread-safe, VC6/VC9, x86/x64).http://windows.php.net/.
• User Contributed Notes “Well worth the effort to set up fast cgi on windows. No more lockups with php
or 40 procs running...and 1 killing IIS. Some PHP INI vars can't be overriden in your php files, so read up (like timeout). 8 months and no more locked up iis.“
“Fast CGI is available for IIS6. Reading the IIS website (which is more appropriate since it is server specific) yields plenty of results regarding PHP setup under the fastCGI module. They even have an entire domain associated with PHP.”
17
Resources
•How WinCache makes PHP run faster http://blogs.iis.net/ksingla/archive/2009/09/19/how-wincache-make-php-run-
faster.aspx
•Using WinCache Extensions for PHP http://learn.iis.net/page.aspx/678/using-windows-cache-extension-for-php/
•Changes Made to PHP 5.3 to Support Windows http://docs.php.net/manual/en/migration53.windows.php
•Migrating from PHP 5.2.x to PHP 5.3.x http://docs.php.net/manual/en/migration53.php
18
19
Summary
Getting up and running with PHP and PHP Applications on Windows is easy.
PHP Apps on Windows are fully functional and are easy to install
WinCache offers a significant performance gain: Customers report up to 3X throughput
improvement
Info at : http://php.iis.net and http://www.microsoft.com/web/php