SlideShare une entreprise Scribd logo
1  sur  62
An Oxymoron’s guide to PHP on Windows
Tim Keller
Lead PHP Developer
Umoya Networks

t/
 @timkeller
e/	 tim@umoya.net
An Oxymoron’s guide to PHP on Windows
Tim Keller
Lead PHP Developer
Umoya Networks

t/
 @timkeller
e/	 tim@umoya.net
www.umoya.net




          Hi, I’m Tim Keller   I do PHP for a living
Oxymoron. Thanks Wikipedia.

 An oxymoron (plural oxymora (greek plural) or, more often, oxymorons)
 ("sharply dull" in Greek) is a figure of speech that combines normally
 contradictory terms.




 An Oxymoron’s Guide to PHP on Windows.
                             OR, BUT HOPEFULLY NOT,



           A sharply dull Guide to PHP on Windows.
The plan

• Quick intro

• History of the oxymoron

• Setting PHP on Windows

• Microsoft Web Platform Installer

• Using ASP.NET AJAX with PHP

• Silverlight with PHP

• Windows Cache Extensions for PHP

• PHP for Azure
A brief history   Once upon a time...
PHP:
Personal Home Page

by Rasmus Lerdorf in
1994
PHP:
Personal Home Page

by Rasmus Lerdorf in
1994

Wanted to get his CV
online, and see how
many users viewed it.

So he wrote a
programming
language.
PHP 2
Perl-like!

by Rasmus Lerdorf in
1995
PHP 2
Perl-like!

by Rasmus Lerdorf in
1995

Perl-ish syntax

Form handling

Embed HTML
PHP 3:
Zeev Suraski and
Andi Gutmans get
involved.
PHP 3:
Zeev Suraski and
Andi Gutmans get
involved.
PHP - a reverse initialism
PHP: Hypertext Preprocessor

Founded Zend Technologies and
rewrote the parser which forms
PHP 4 (May 2000).

Released PHP 5 in 2004.

PHP 6 is “in progress”
Why PHP matters

• Web Applications   • Commercial entities
  • Wordpress          • Yahoo!
  • Drupal             • Flickr
  • Joomla             • Digg
  • phpBB              • Facebook
  • MediaWiki          • YouTube
  • SugarCRM           • Wikipedia
  • Gallery2           • myYearBook
HARD TO IGNORE.
Timeline

• Since the dawn of time
  PHP on Windows IIS is miserably bad.
Running PHP on Windows (using IIS)
Running PHP on Windows (using IIS)
Running PHP on Windows (using IIS)


 CGI
Running PHP on Windows (using IIS)


 CGI
 Invokes a new
 php.exe process for
 each request

 Advantage
 • Very stable

 Disadvantage
 • SLOW due to I/O
   overhead of Process
   Creation on Windows
Running PHP on Windows (using IIS)


 CGI
 Invokes a new
 php.exe process for
 each request

 Advantage
 • Very stable

 Disadvantage
 • SLOW due to I/O
   overhead of Process
   Creation on Windows
Running PHP on Windows (using IIS)


 CGI                     ISAPI
 Invokes a new
 php.exe process for
 each request

 Advantage
 • Very stable

 Disadvantage
 • SLOW due to I/O
   overhead of Process
   Creation on Windows
Running PHP on Windows (using IIS)


 CGI                     ISAPI
 Invokes a new           PHP Loaded as an
 php.exe process for     extension in IIS’s
 each request            memory space

 Advantage               Advantage
 • Very stable           • Better performance

 Disadvantage            Disadvantage
 • SLOW due to I/O       • Not very stable
   overhead of Process   • Many PHP (PECL)
   Creation on Windows     extensions are not
                           Thread-Safe
Running PHP on Windows (using IIS)


 CGI                     ISAPI
 Invokes a new           PHP Loaded as an
 php.exe process for     extension in IIS’s     THE OXYMORON
 each request            memory space
                                                Performance
 Advantage               Advantage
 • Very stable           • Better performance        vs.
 Disadvantage            Disadvantage
                                                 Reliability
 • SLOW due to I/O       • Not very stable
   overhead of Process   • Many PHP (PECL)
   Creation on Windows     extensions are not
                           Thread-Safe
Timeline

• Since the dawn of time
  PHP on Windows IIS is miserably bad.


• 2006
  Zend and Microsoft announce collaboration


• 2007
  Zend and PHP Core Devs start optimising PHP 5.2.x builds for
  windows.


• 2008
  MS release IIS7 with native FastCGI for PHP.
  FastCGI extensions for IIS6 released.
Running PHP on Windows (using IIS)


 CGI                     ISAPI
 Invokes a new           PHP Loaded as an
 php.exe process for     extension in IIS’s
 each request            memory space

 Advantage               Advantage
 • Very stable           • Better performance

 Disadvantage            Disadvantage
 • SLOW due to I/O       • Not very stable
   overhead of Process   • Many PHP (PECL)
   Creation on Windows     extensions are not
                           Thread-Safe
Running PHP on Windows (using IIS)


 CGI                     ISAPI                  FastCGI
 Invokes a new           PHP Loaded as an       Process caching and
 php.exe process for     extension in IIS’s     pooling mechanism
 each request            memory space
                                                Advantage
 Advantage               Advantage              • Faster than CGI
 • Very stable           • Better performance   • More Stable than
                                                  ISAPI
 Disadvantage            Disadvantage           • Can run non-thread-
 • SLOW due to I/O       • Not very stable        safe versions of PHP
   overhead of Process   • Many PHP (PECL)        and PECL extensions
   Creation on Windows     extensions are not
                           Thread-Safe
How FastCGI makes PHP on IIS awesome


                              FastCGI
                              Process caching and
                              pooling mechanism

                              Advantage
                              • Faster than CGI
                              • More Stable than
                                ISAPI
                              • Can run non-thread-
                                safe versions of PHP
                                and PECL extensions
How FastCGI makes PHP on IIS awesome

                       IIS 7.x Worker Process


  Request
             Read
                                                                   FastCGI
   queue

                                                                   Process caching and
            Authenti
                                    ASP.NET
            Authoriz                                               pooling mechanism
              Map

                           Static             FastCGI              Advantage
            Handle                            handler
                                                                   • Faster than CGI
             Send
                                                                   • More Stable than
              Log                                                    ISAPI
                                                                   • Can run non-thread-
                                                                     safe versions of PHP
                                                                     and PECL extensions

                        4                                      5
      Pool of PHP 4                                Pool of PHP 5
        binaries                                     binaries
Tuning FastCGI

• Loads of runtime parameters.


• Maximum FastCGI instances

 C:WindowsSystem32inetsrvconfigapplicationHost.config

 <fastCgi>
   <application fullPath="C:PHPphp-cgi.exe" maxInstances="32">
   </application>
 </fastCgi>
Timeline

• 2008
  MS release IIS7 with native FastCGI for PHP.
  FastCGI extensions for IIS6 released.

 Microsoft’s Pierre Joye and the PHP community conduct major
 work on the PHP 5.3 codebase.


  • Fixed 60+ Windows-specific bugs

  • Updated every library to latest version
    (some were 10+ years old)

  • Compiled with VC++ 9 (VS 2008)

  • x86 and x64 builds for Windows
The “PHP on Windows” era




                             IIS7


                      IIS6
             IIS5
<?php
print “Live Demo”
?>




                 1. Manually
Setting up PHP   2. Web Platform Installer
<?php
 print “Live Demo”
 ?>


  PHP4   PHP5.2   PHP5.3     PHP6.0




Multiple Versions      The holy grail, apparently.
Microsoft Web Platform Installer
              • Simple, yet powerful installer for:


                 • PHP and ASP.NET binaries,


                 • PHP and ASP.NET 3rd party apps.


              • Available at http://www.microsoft.com/web
<?php
  print “Live Demo”
  ?>




Quick look at WPI   microsoft.com/web
&




ASP.NET AJAX   and PHP
What is AJAX?

• Asynchronous Javascript and XML (or JSON, HTML, text...)
• Sometimes: Dynamic HTML, Partial Page updates, Rich Internet Apps.


           Traditional Client/Server       AJAX Paradigm



             User Interface              User Interface



         Request             Response      Ajax Engine



               Web Server                  Web Server
ASP.NET AJAX

• A libraries in three parts:

   • MS AJAX Library
     Javascript files for the browser

   • ASP.NET AJAX Extensions           PHP MS AJAX library on Codeplex
     Server-side ASP.NET code          http://codeplex.com/phpmsajax

   • ASP.NET Ajax Control Toolkit
     Shared-source components
ASP.NET AJAX

• A libraries in three parts:

   • MS AJAX Library
     Javascript files for the browser

   • ASP.NET AJAX Extensions           PHP MS AJAX library on Codeplex
     Server-side ASP.NET code          http://codeplex.com/phpmsajax

   • ASP.NET Ajax Control Toolkit
     Shared-source components
ASP.NET AJAX

• A libraries in three parts:

   • MS AJAX Library
     Javascript files for the browser

   • ASP.NET AJAX Extensions           PHP MS AJAX library on Codeplex
     Server-side ASP.NET code          http://codeplex.com/phpmsajax

   • ASP.NET Ajax Control Toolkit
     Shared-source components
ASP.NET AJAX

• A libraries in three parts:

   • MS AJAX Library
     Javascript files for the browser

   • ASP.NET AJAX Extensions           PHP MS AJAX library on Codeplex
     Server-side ASP.NET code          http://codeplex.com/phpmsajax

   • ASP.NET Ajax Control Toolkit
     Shared-source components
<?php
         print “Live Demo”
         ?>




PHP Class encapsulation   Demo using Firebug
    over ASP.NET AJAX
Microsoft Silverlight   and PHP
Hi, haaaave you met XAML?

• Extensible Application Markup Language

• XML-based descripton language for Rich User Interfaces

• Part of the Windows Presentation Foundation (WPF)

 <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
 	     <TextBlock>Hello World!</TextBlock>
 </Canvas>




• PHP can easily output text/xml.
<?php
     print “Live Demo”
     ?>




Generate Silverlight   from PHP
WinCache   for PHP
WinCache what?

• Windows Cache Extension for PHP

  • PHP accelerator (like Zend Optimizer or APC)

  • Speeds up PHP applications running on Windows without any code
    modifications.

  • OpenSource (http://www.php.net/wincache)

• Caches


                                                     Relative
   ByteCode                  File Cache              File Path
    Cache
                                                      Cache
PHP + WinCache vs Zend Server + Zend Optimiser
<?php
       print “Live Demo”
       ?>




WinCache’d Wordpress   More bang for your cache
CREATE APPS WITH
            .NET,
          PHP, & Java




and PHP
Azure
PHP talking to Azure
The PHP Azure SDK:

• PHP classes for Windows Azure Blobs, Tables & Queues (for CRUD
  operations)


• Support for storing PHP sessions in Azure Table Storage
A lot is happening...

• This week

  • PHP WinCache Final Release

  • IIS SEO tool for Windows v1 Final Release

  • ASP.NET MVC 2 beta

  • ASP.NET AJAX library now in Beta

  • IIS App Request Router v2 Final Release


• And more in the coming weeks...
Links

• IIS

   • http://php.iis.net

• PHP

   • Download: http://windows.php.net

• ASP.NET AJAX

   • http://phpmsajax.codeplex.com

   • http://ajax.asp.net

• PHP Azure

   • http://phpazure.codeplex.com
The Silicon Cape Initiative...

...identified the lack of skilled software developers in the
startup-space as a major inhibitor of local innovation.

SA Developer.net and other local user groups are in a
strong position to train, enthuse and mentor the next
generation of local web startups.

If we can get passed the Microsoft vs. OpenSource
mentality and focus on code, we can do some seriously
awesome things in this city.




          Develophpers                You rock
Tim Keller
Lead PHP Developer
Umoya Networks

t/
 @timkeller
e/	 tim@umoya.net

Interwebs
timk.co.za
umoya.net
mystaffroom.net




Thanks for your time   THE END

Contenu connexe

Dernier

Dernier (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

En vedette

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

An Oxymoron's Guide to PHP on Windows

  • 1. An Oxymoron’s guide to PHP on Windows Tim Keller Lead PHP Developer Umoya Networks t/ @timkeller e/ tim@umoya.net
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. An Oxymoron’s guide to PHP on Windows Tim Keller Lead PHP Developer Umoya Networks t/ @timkeller e/ tim@umoya.net
  • 8. www.umoya.net Hi, I’m Tim Keller I do PHP for a living
  • 9. Oxymoron. Thanks Wikipedia. An oxymoron (plural oxymora (greek plural) or, more often, oxymorons) ("sharply dull" in Greek) is a figure of speech that combines normally contradictory terms. An Oxymoron’s Guide to PHP on Windows. OR, BUT HOPEFULLY NOT, A sharply dull Guide to PHP on Windows.
  • 10. The plan • Quick intro • History of the oxymoron • Setting PHP on Windows • Microsoft Web Platform Installer • Using ASP.NET AJAX with PHP • Silverlight with PHP • Windows Cache Extensions for PHP • PHP for Azure
  • 11. A brief history Once upon a time...
  • 12. PHP: Personal Home Page by Rasmus Lerdorf in 1994
  • 13. PHP: Personal Home Page by Rasmus Lerdorf in 1994 Wanted to get his CV online, and see how many users viewed it. So he wrote a programming language.
  • 14. PHP 2 Perl-like! by Rasmus Lerdorf in 1995
  • 15. PHP 2 Perl-like! by Rasmus Lerdorf in 1995 Perl-ish syntax Form handling Embed HTML
  • 16. PHP 3: Zeev Suraski and Andi Gutmans get involved.
  • 17. PHP 3: Zeev Suraski and Andi Gutmans get involved. PHP - a reverse initialism PHP: Hypertext Preprocessor Founded Zend Technologies and rewrote the parser which forms PHP 4 (May 2000). Released PHP 5 in 2004. PHP 6 is “in progress”
  • 18. Why PHP matters • Web Applications • Commercial entities • Wordpress • Yahoo! • Drupal • Flickr • Joomla • Digg • phpBB • Facebook • MediaWiki • YouTube • SugarCRM • Wikipedia • Gallery2 • myYearBook
  • 20. Timeline • Since the dawn of time PHP on Windows IIS is miserably bad.
  • 21. Running PHP on Windows (using IIS)
  • 22. Running PHP on Windows (using IIS)
  • 23. Running PHP on Windows (using IIS) CGI
  • 24. Running PHP on Windows (using IIS) CGI Invokes a new php.exe process for each request Advantage • Very stable Disadvantage • SLOW due to I/O overhead of Process Creation on Windows
  • 25. Running PHP on Windows (using IIS) CGI Invokes a new php.exe process for each request Advantage • Very stable Disadvantage • SLOW due to I/O overhead of Process Creation on Windows
  • 26. Running PHP on Windows (using IIS) CGI ISAPI Invokes a new php.exe process for each request Advantage • Very stable Disadvantage • SLOW due to I/O overhead of Process Creation on Windows
  • 27. Running PHP on Windows (using IIS) CGI ISAPI Invokes a new PHP Loaded as an php.exe process for extension in IIS’s each request memory space Advantage Advantage • Very stable • Better performance Disadvantage Disadvantage • SLOW due to I/O • Not very stable overhead of Process • Many PHP (PECL) Creation on Windows extensions are not Thread-Safe
  • 28. Running PHP on Windows (using IIS) CGI ISAPI Invokes a new PHP Loaded as an php.exe process for extension in IIS’s THE OXYMORON each request memory space Performance Advantage Advantage • Very stable • Better performance vs. Disadvantage Disadvantage Reliability • SLOW due to I/O • Not very stable overhead of Process • Many PHP (PECL) Creation on Windows extensions are not Thread-Safe
  • 29. Timeline • Since the dawn of time PHP on Windows IIS is miserably bad. • 2006 Zend and Microsoft announce collaboration • 2007 Zend and PHP Core Devs start optimising PHP 5.2.x builds for windows. • 2008 MS release IIS7 with native FastCGI for PHP. FastCGI extensions for IIS6 released.
  • 30. Running PHP on Windows (using IIS) CGI ISAPI Invokes a new PHP Loaded as an php.exe process for extension in IIS’s each request memory space Advantage Advantage • Very stable • Better performance Disadvantage Disadvantage • SLOW due to I/O • Not very stable overhead of Process • Many PHP (PECL) Creation on Windows extensions are not Thread-Safe
  • 31. Running PHP on Windows (using IIS) CGI ISAPI FastCGI Invokes a new PHP Loaded as an Process caching and php.exe process for extension in IIS’s pooling mechanism each request memory space Advantage Advantage Advantage • Faster than CGI • Very stable • Better performance • More Stable than ISAPI Disadvantage Disadvantage • Can run non-thread- • SLOW due to I/O • Not very stable safe versions of PHP overhead of Process • Many PHP (PECL) and PECL extensions Creation on Windows extensions are not Thread-Safe
  • 32. How FastCGI makes PHP on IIS awesome FastCGI Process caching and pooling mechanism Advantage • Faster than CGI • More Stable than ISAPI • Can run non-thread- safe versions of PHP and PECL extensions
  • 33. How FastCGI makes PHP on IIS awesome IIS 7.x Worker Process Request Read FastCGI queue Process caching and Authenti ASP.NET Authoriz pooling mechanism Map Static FastCGI Advantage Handle handler • Faster than CGI Send • More Stable than Log ISAPI • Can run non-thread- safe versions of PHP and PECL extensions 4 5 Pool of PHP 4 Pool of PHP 5 binaries binaries
  • 34. Tuning FastCGI • Loads of runtime parameters. • Maximum FastCGI instances C:WindowsSystem32inetsrvconfigapplicationHost.config <fastCgi> <application fullPath="C:PHPphp-cgi.exe" maxInstances="32"> </application> </fastCgi>
  • 35. Timeline • 2008 MS release IIS7 with native FastCGI for PHP. FastCGI extensions for IIS6 released. Microsoft’s Pierre Joye and the PHP community conduct major work on the PHP 5.3 codebase. • Fixed 60+ Windows-specific bugs • Updated every library to latest version (some were 10+ years old) • Compiled with VC++ 9 (VS 2008) • x86 and x64 builds for Windows
  • 36. The “PHP on Windows” era IIS7 IIS6 IIS5
  • 37. <?php print “Live Demo” ?> 1. Manually Setting up PHP 2. Web Platform Installer
  • 38. <?php print “Live Demo” ?> PHP4 PHP5.2 PHP5.3 PHP6.0 Multiple Versions The holy grail, apparently.
  • 39. Microsoft Web Platform Installer • Simple, yet powerful installer for: • PHP and ASP.NET binaries, • PHP and ASP.NET 3rd party apps. • Available at http://www.microsoft.com/web
  • 40. <?php print “Live Demo” ?> Quick look at WPI microsoft.com/web
  • 41. & ASP.NET AJAX and PHP
  • 42. What is AJAX? • Asynchronous Javascript and XML (or JSON, HTML, text...) • Sometimes: Dynamic HTML, Partial Page updates, Rich Internet Apps. Traditional Client/Server AJAX Paradigm User Interface User Interface Request Response Ajax Engine Web Server Web Server
  • 43. ASP.NET AJAX • A libraries in three parts: • MS AJAX Library Javascript files for the browser • ASP.NET AJAX Extensions PHP MS AJAX library on Codeplex Server-side ASP.NET code http://codeplex.com/phpmsajax • ASP.NET Ajax Control Toolkit Shared-source components
  • 44. ASP.NET AJAX • A libraries in three parts: • MS AJAX Library Javascript files for the browser • ASP.NET AJAX Extensions PHP MS AJAX library on Codeplex Server-side ASP.NET code http://codeplex.com/phpmsajax • ASP.NET Ajax Control Toolkit Shared-source components
  • 45. ASP.NET AJAX • A libraries in three parts: • MS AJAX Library Javascript files for the browser • ASP.NET AJAX Extensions PHP MS AJAX library on Codeplex Server-side ASP.NET code http://codeplex.com/phpmsajax • ASP.NET Ajax Control Toolkit Shared-source components
  • 46. ASP.NET AJAX • A libraries in three parts: • MS AJAX Library Javascript files for the browser • ASP.NET AJAX Extensions PHP MS AJAX library on Codeplex Server-side ASP.NET code http://codeplex.com/phpmsajax • ASP.NET Ajax Control Toolkit Shared-source components
  • 47. <?php print “Live Demo” ?> PHP Class encapsulation Demo using Firebug over ASP.NET AJAX
  • 49. Hi, haaaave you met XAML? • Extensible Application Markup Language • XML-based descripton language for Rich User Interfaces • Part of the Windows Presentation Foundation (WPF) <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <TextBlock>Hello World!</TextBlock> </Canvas> • PHP can easily output text/xml.
  • 50. <?php print “Live Demo” ?> Generate Silverlight from PHP
  • 51. WinCache for PHP
  • 52. WinCache what? • Windows Cache Extension for PHP • PHP accelerator (like Zend Optimizer or APC) • Speeds up PHP applications running on Windows without any code modifications. • OpenSource (http://www.php.net/wincache) • Caches Relative ByteCode File Cache File Path Cache Cache
  • 53. PHP + WinCache vs Zend Server + Zend Optimiser
  • 54. <?php print “Live Demo” ?> WinCache’d Wordpress More bang for your cache
  • 55. CREATE APPS WITH .NET, PHP, & Java and PHP
  • 56. Azure
  • 57. PHP talking to Azure
  • 58. The PHP Azure SDK: • PHP classes for Windows Azure Blobs, Tables & Queues (for CRUD operations) • Support for storing PHP sessions in Azure Table Storage
  • 59. A lot is happening... • This week • PHP WinCache Final Release • IIS SEO tool for Windows v1 Final Release • ASP.NET MVC 2 beta • ASP.NET AJAX library now in Beta • IIS App Request Router v2 Final Release • And more in the coming weeks...
  • 60. Links • IIS • http://php.iis.net • PHP • Download: http://windows.php.net • ASP.NET AJAX • http://phpmsajax.codeplex.com • http://ajax.asp.net • PHP Azure • http://phpazure.codeplex.com
  • 61. The Silicon Cape Initiative... ...identified the lack of skilled software developers in the startup-space as a major inhibitor of local innovation. SA Developer.net and other local user groups are in a strong position to train, enthuse and mentor the next generation of local web startups. If we can get passed the Microsoft vs. OpenSource mentality and focus on code, we can do some seriously awesome things in this city. Develophpers You rock
  • 62. Tim Keller Lead PHP Developer Umoya Networks t/ @timkeller e/ tim@umoya.net Interwebs timk.co.za umoya.net mystaffroom.net Thanks for your time THE END