SlideShare a Scribd company logo
Cloud and evolutions of the Microsoft platform



What’s new for Open Source, PHP
and Cloud Computing in the
Microsoft environment.




Pierre Couzy - Microsoft



Laurent Bonnet - Microsoft
Agenda
• The (relatively) new Microsoft/OSS story
• A new PHP platform on Windows
   • Running PHP on Windows
   • PHP apps on Windows
   • Opening Windows products to PHP
• Cloud story : PHP on Windows Azure
   • The Why
   • The How
Introduction

PHP on Windows :
 • Has been around for a decade
 • Actually, most PHP development is done
   on Windows
 • And yet, the Microsoft-PHP story has
   been difficult for years.
Open Source at Microsoft ?

Open Source Technology Center
3 goals :
I.     Get Involved with Open Source
       communities
II.    Ensure major projects run correctly on the
       Windows Operating Systems
III.   Open our products and platform to non-
       Microsoft stacks
OSTC : in the early days …


Founded in 2004

           2 computers

                         One guy…
OSTC today

• Hosted in Redmond
  • Staffed by OSS and Linux
    experts
  • 300 servers of varying types
  • 340+ Linux distros available
    for testing
  • Tests interoperability of OSS
    and Windows
  • Research of OSS
    technologies
Results ?
A SQL Server driver for PHP ?

• Done in collaboration with the PHP community
• Published on CodePlex with an OSI-approved
  license (http://sqlsrvphp.codeplex.com/).
• Can access any Sql Server instance (Express, 2005,
  2008, 2008 R2, Azure) from PHP
• Work in progress : enable Sql Server access to
  major PHP projects & frameworks
And also
OSTC has changed Microsoft
• We contributed to the linux kernel
• GPL developers do exist in Redmond
• On-going collaboration
   • With the Apache Software Foundation
   • With communities
• There’s still room for improvement
   • A typical project is still 1 month dev, 3
     months stabilization, 1 year legal…
Agenda
• The (relatively) new Microsoft/OSS story
• A new PHP platform on Windows
   • Running PHP on Windows
   • PHP apps on Windows
   • Opening Windows products to PHP
• Cloud story : PHP on Windows Azure
   • The Why
   • The How
A PHP Windows platform ?
•   Application: PHP
•   DB: SQL Server, MySql, etc.
•   Web Server: Internet Information Services (IIS)
•   OS: Windows Server 2008 / 2008 R2
From CGI to FastCGI

      One request, One              PHP runtime lives             PHP runtime
CGI




                            ISAPI




                                                        FastCGI
      process                       in IIS or in a                handled by a
                                    surrogate process             process pool


      The good                      The good
      • Very stable                                               The good
                                    • Very fast
                                                                  • Faster than CGI
      The bad                       The bad                       • More robust than
                                                                    ISAPI
      • *SLOW* on Windows
        (spawning a new             • Stability                   • No more threading
        process)                    • Thread safety                 issues
Démo
Also available on Server Core


• A “distro” that minimizes footprint and
  attack surface

• PHP runs on
  Server Core
  since Windows
  Server 2008
Creating a new Build Process
               Using better tools to do a better job

Unix ‘configure’-style makefiles                      Created a clean, unified build

• Makefiles are generated using Unix-style            •Using tools built by the OSTC, we have constructed a
  configure scripts. Functionality is emulated with    better build process which opens many new
  JScript                                              possibilities, yet can easily adapt to new changes by
                                                       developers using older technologies.

No Optimizations                                      One unified set of properties
• Makefiles are generated with no ability to          •Generated project files use a single set of build
  optimize entire builds, nor take advantage of        configuration files, allowing 100% of the code to be
  better tools, compilers, etc.                        built to the same specifications.

Independent Dependencies                              Optimizations everywhere

• Libraries never compiled with the same              •The new process lets us take advantage of high-
  settings.                                            performance PGO technology to improve the
                                                       performance of PHP by leaps and bounds.

Undefined process                                     Limitless opportunities

• Very few people had all the right bits/tools to     •With the new process, we can now do instrumented
  even compile the Windows PHP binaries—               builds of the entire stack, allowing us to analyze and
  Certainly impossible to replicate an exact build.    improve PHP for any environment.
Using VC 9
           What a difference the compiler makes


VC 6 builds                                     VC 9 builds

• Visual C++ 6.0, being over a decade old,      • Visual C++ 9.0 provides technologies that
  would not produce code optimized for            allow us to target today’s operating
  modern operating systems and                    systems and hardware.
  hardware.

                                                New Compiler
Older Compiler
                                                • By just changing the compiler, generates
• PHP on Windows was being left behind,           code that performs better, even before
  simply because it was nearly impossible         using advanced PGO technologies.
  to build with any other compiler
                                                Now, 64 bit support
No 64 bit support
                                                • We are now building 64bit snapshot
• VC 6 offered no ability to build for 64 bit     builds alongside the 32 bit builds, 95%+
  Windows                                         libraries are 64 bit too.
Going native
                Using Windows APIs on Windows…

                                                     Eliminated POSIX emulation
Heavy use of POSIX emulation
                                                     • Dropped the POSIX emulation libraries, and
• PHP has been built with POSIX in mind, and
                                                       code has been written to use Win32 APIs
  therefore, on Windows it was natural to adopt
                                                       correctly.
  emulation libraries to accomplish similar tasks.

                                                     Choosing the Win32 Way
Using wrong methods
                                                     • Implemented features in a way that doesn’t
• Often, the way to do something on Unix, is not
                                                       mimic the method on Unix, just the results.
  the way to do it on Windows.

                                                     Use native libraries/APIs
Non-standard Implementations
                                                     • Replaced that code with calls to the natively
• Many libraries were being used to supply
                                                       provided APIs.
  functionality that was already present in
  Windows (Crypto, DNS, etc)
                                                     Targets new OS, gracefully
Targeted oldest OS possible
                                                     • Recent code changes now allow us to target
                                                       features on the latest versions of Windows, and
• Windows 98 was considered a primary target…
                                                       provides graceful failure on down-level
  ‘nuff said!
                                                       platforms.
Testing and QA
                 Using Windows APIs on Windows…


Unix was the primary platform
                                                    Windows is a primary platform
• If it worked on a Unix platform, it was done...
  Windows was never given any attention, nor        •Windows is now a primary platform, and changes
  care by hardly anyone                              which break Windows must be addressed.

                                                    98%+ tests now pass on Windows.
Tests did not have high pass rate.
                                                    •Over 98% of tests now pass on Windows, and we’re
• The standard PHP test suite did not pass with a    aiming to close the gap completely.
  strong success rate.
                                                    Windows is now represented
Security was a Unix concern.
                                                    •Windows developers are now on the security mailing
• Security considerations for Windows were not       lists, and can take action at the same time.
  taking place, no Windows developers were on
  the Security Mailing Lists                        New Testing Tools

                                                    •The OSTC has created new tools for testing FastCGI
No tools for doing automated testing.                and PHP builds that can be included in the official
                                                     build process, providing PGO and instrumentation
• Nearly no tools to assist in automation of         data to the developers.
  testing on Windows at all.
Release Process
                   Same Day Service…with a smile


                                                Windows is a primary platform
Unix was the primary platform
                                                • Windows gets the same ability to push
• Unix Platforms was the only concern.            back on Release Dates, and builds are
                                                  done on both platforms on the same day.
Single point of failure.
                                                Easy to replicate.
• Builds for Windows were constrained by
  a single person’s ability to make the build   • It is now simple for anyone to rebuild the
  happen.                                         exact same PHP stack on Windows as the
                                                  release build.
No attention to details.
                                                New work on the installer.
• Hardly anyone worked on Windows
  releases, and the installer was poor.         • New work is being done to improve the
                                                  installer for the Windows platform.
Where are we now ?
• PHP is at last maintained on Windows.
   • And ready for production
   • http://windows.php.net
• Performance tuning is on its way
   • We are getting on par with LAMP
   • Ongoing work on caching
• We still lack many modules for 5.3
   • That’s our top priority right now
Web Plaform Installer
                                         http://www.microsoft.com/web
• A tool to install and configure
   •   IIS
   •   Frameworks and runtimes (.NET / PHP)
   •   Databases (SQL Server, MySQL)
   •   Tools (Visual Web Developper 2008, Silverlight 3 Tools for VS)

• And Web apps
   • Blogs (phpBB, WordPress, DasBlog, …)
   • Wikis, Galleries, etc.
   • CMS (DotNetNuke, Drupal, SilverStripe, ...)
What’s next
Windows Cache Extension 1.0 for PHP
PHP Connectivity to Windows Azure
Word and Excel reading and writing
Windows Live services
PDO Driver for Sql Server
…
Working in sync with you on the most popular
 applications
Web Platform Installer
Agenda
• The (relatively) new Microsoft/OSS story
• A new PHP platform on Windows
   • Running PHP on Windows
   • PHP apps on Windows
   • Opening Windows products to PHP
• Cloud story : PHP on Windows Azure
   • The Why
   • The How
Cloud terms & actors in a nutshell
• Infrastructure as a Service : bring your OS
• Platform as a service : bring your App
• Infrastructure as a service : use our App
How does your app handle load ?


                                                                   peak load

       Usage                                                    Idle time


               Jan            Apr              Jul        Oct

                                                                             Cloud
                          Cloud p1 p2 p3
Web Tier       B/L Tier

Web Tier       B/L Tier             Database         Web Tier     B/L Tier           Database

Web Tier       B/L Tier
How does your app share data ?




                                          I love
    I love you!
                                         you too!

                  Server          Data


                      Company A
Scenarios for Data
                                                   In-browser
                                                   Application
                                               (JSON & AtomPub
                                                Support in Azure)

              Public Cloud
     Server
                                        Data
     Server

     Server


                                               Company B


                   Server               Data       Server


                            Company A
Your app, my accounts ?



                          Federated Identity               Your App
      Your App                Provider




                 Account DB            Your        Your
Entreprise
                  for a web         University   OpenID          …
 directory
                     app             account     account
The Windows Azure cloud infrastructure
We Start with Lots of Blinking Lights and Cables
We Put them Into Racks
Then, we add software
• A hypervisor, on top of which
  a Host Virtual Machine,
  on top of which
  many Virtual Machines



            CPU: x64
            OS : Windows 2008
            Web Server : IIS 7
            Apps : .Net, PHP, C++, etc.
Then, we add redundancy logic

   Front-end Node                       Front-end Node                  Front-end Node

       REST/SOAP                            REST/SOAP                       REST/SOAP
                                                                                                                     front-end
        ACE Logic                            ACE Logic                       ACE Logic
    Data Access Library                  Data Access Library             Data Access Library




                                                                                                              Master Cluster

                 Service Management

                                                Health                                           Master Node                      Master Node
 Provisioning             Deployment
                                               Monitoring
                                                                                                Partition Manager                Partition Manager

                                                                                                   Data Node                        Data Node
                                                                                                  Components                       Components




                                                                 Data Cluster

         Data Node                      Data Node                 Data Node                       Data Node                        Data Node

      SQL                           SQL                         SQL                             SQL                           SQL
     Server          Mgmt.         Server         Mgmt.        Server      Mgmt.               Server      Mgmt.             Server         Mgmt.
                    Services                     Services                 Services                        Services                         Services
     Fabric                        Fabric                      Fabric                          Fabric                        Fabric


          Fabric                                                        Fetch Partition                                  SQL
                                       Replication
                                                                             Map                                        Client
Which leads to :
Running code on Azure
• We re-use the existing IIS infrastructure

• FastCGI allows us to plug in almost every
  language
   • For example, you can package PHP,
   • .. Including your own extensions and
     configuration,
   • Point PHP files to PHP-CGI.exe,
   • .. And run them directly

• Let’s see that in action.
Running code on Azure
Data on Azure


• A basic storage infrastructure : Azure Storage
   • Blobs (think files)
   • Tables (think Flat File database)
   • Queues (messages)
   • Access is done using REST

• A SQL-Server engine : SQL Azure
   • A subset of SQL Server 2008
   • Including Views, Stored Procedures, etc.
   • Access is done using TDS
Using Azure Storage
• http://phpazure.codeplex.com/
• Overview
   • Enables PHP developers to take advantage
     of the Microsoft Cloud Services Platform – Windows
     Azure.
   • Provides consistent programming model for Windows
     Azure Storage (Blobs, Tables & Queues)
• Features
   • PHP classes for Windows Azure Blobs, Tables & Queues
     (for CRUD operations)
   • Helper Classes for HTTP transport, AuthN/AuthZ, REST &
     Error Management
   • Manageability, Instrumentation & Logging support
   • Support for storing PHP sessions in Azure Table Storage
• Licence : BSD
Using Sql Azure



• http://www.codeplex.com/SQLSRVPHP
• Licence : Microsoft Public License (Ms-PL)
• Gives access to SQL Server databases,
   • But also SQL Azure
Consuming Sql Azure
... in PHP
… with Eclipse
We do our best to be technology-agnostic


        Azure Services Platform
             ™
PHP,  Cloud And  Microsoft    Symfony  Live 2010
Thank you, and stay
tuned for more (Symfony
on Azure ?)
Links
• www.azure .com : main entry point
• http://sqlazuremw.codeplex.com/
   • Migration Wizard (Sql Server -> Sql Azure)
• http://www.codeplex.com/SQLSRVPHP
   • Accessing data using TDS (Sql Server, Sql Azure)
• http://phpazure.codeplex.com/
   • Accessing Azure Storage in PHP
• http://windows.php.net
   • Latest PHP binaries & Source
• http://www.microsoft.com/downloads/details.aspx?FamilyID=413E
  88F8-5966-4A83-B309-53B7B77EDF78&displaylang=en
   • Standard Azure Training Kit, contains samples to run PHP on
      Azure
• http://phpdataservices.codeplex.com/
   • Accessing REST data using PHP

More Related Content

PDF
Getting Started with Node.js
KEY
Zend Code in ZF 2.0
PDF
A Tale of Two Toolkits
PDF
PHP Frameworks Review - Mar 19 2015
PDF
Industrialise PHP ~ ZendCon Europe 2013
PDF
ITCamp 2011 - Alessandro Pilotti - Optimizing ASPNet and PHP apps on IIS 7.5
KEY
Get your Project back in Shape!
PDF
LWF 101 for Open Hack Day
Getting Started with Node.js
Zend Code in ZF 2.0
A Tale of Two Toolkits
PHP Frameworks Review - Mar 19 2015
Industrialise PHP ~ ZendCon Europe 2013
ITCamp 2011 - Alessandro Pilotti - Optimizing ASPNet and PHP apps on IIS 7.5
Get your Project back in Shape!
LWF 101 for Open Hack Day

What's hot (20)

PPTX
Dd13.2013.milano.open ntf
PDF
The Architect Way - JSCamp.asia 2012
PDF
Maven: from Scratch to Production (.pdf)
PDF
CLA Summit 2013: Connecting LabVIEW to Everything Else
 
KEY
Building Android apps with Maven
PDF
Eclipse OMR: a modern toolkit for building language runtimes
PPTX
Object Oriented Programming I
PDF
UKLUG 2012 - XPages, Beyond the basics
PDF
Web services on IBM i with PHP and Zend Framework
PDF
Enterprise OSGi at eBay
PPTX
Symfony2 for legacy app rejuvenation: the eZ Publish case study
PDF
BP-10 Keeping Your Sanity – Rapid Development & Deployment Tools
PDF
Perforce's Java Platform: Continuous Integration For Real
PDF
Pie chart with center 11 stages powerpoint diagrams and powerpoint templates
PPTX
MWLUG 2015 - An Introduction to MVC
PDF
Modernisation of Legacy PHP Applications to Symfony2 - Symfony Live Berlin 2012
PPTX
#JavaOne What's in an object?
PDF
Stackato v6
PDF
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
PPT
XPages -Beyond the Basics
Dd13.2013.milano.open ntf
The Architect Way - JSCamp.asia 2012
Maven: from Scratch to Production (.pdf)
CLA Summit 2013: Connecting LabVIEW to Everything Else
 
Building Android apps with Maven
Eclipse OMR: a modern toolkit for building language runtimes
Object Oriented Programming I
UKLUG 2012 - XPages, Beyond the basics
Web services on IBM i with PHP and Zend Framework
Enterprise OSGi at eBay
Symfony2 for legacy app rejuvenation: the eZ Publish case study
BP-10 Keeping Your Sanity – Rapid Development & Deployment Tools
Perforce's Java Platform: Continuous Integration For Real
Pie chart with center 11 stages powerpoint diagrams and powerpoint templates
MWLUG 2015 - An Introduction to MVC
Modernisation of Legacy PHP Applications to Symfony2 - Symfony Live Berlin 2012
#JavaOne What's in an object?
Stackato v6
Lessons learned from building Eclipse-based add-ons for commercial modeling t...
XPages -Beyond the Basics
Ad

Viewers also liked (20)

PPTX
Developer design services
PPTX
H2o Recycle
PPT
Masa Depanku Stefanie 6c
PPT
Komputerku Rania 4a
DOCX
Harry: "Community Garden"
ODP
Album aula 8
PPT
Llibertat
PPT
for test7
PPT
Greenathan
PPT
Quale futuro per l'acqua
PPT
Street Fighter
PPT
Komputerku Nabila 4 B
PDF
Paint the planet with green
DOC
PPTX
Mitchell
PPTX
Artificial intelligence prelims - answers
PPT
Edlt528 group3 vision_learningproject
PPTX
Presentation1
PDF
Rain water harvesting
DOC
Nghi dinh 171-2013-nd-cp
Developer design services
H2o Recycle
Masa Depanku Stefanie 6c
Komputerku Rania 4a
Harry: "Community Garden"
Album aula 8
Llibertat
for test7
Greenathan
Quale futuro per l'acqua
Street Fighter
Komputerku Nabila 4 B
Paint the planet with green
Mitchell
Artificial intelligence prelims - answers
Edlt528 group3 vision_learningproject
Presentation1
Rain water harvesting
Nghi dinh 171-2013-nd-cp
Ad

Similar to PHP, Cloud And Microsoft Symfony Live 2010 (20)

PDF
Php on Windows
KEY
Continuous Integration In A PHP World
PDF
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
PDF
Configuration manager presentation
PPTX
PHP Unconference Continuous Integration
PDF
Continuous Integration at Mollie
PPTX
How bigtop leveraged docker for build automation and one click hadoop provis...
PDF
321 codeincontainer brewbox
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
KEY
Portable infrastructure with puppet
PDF
How bigtop leveraged docker for build automation and one click hadoop provis...
PPTX
Get acquainted with the new ASP.Net 5
PPTX
A Lap Around Visual Studio 11
PPTX
Vagrant to-aws-flow
PPTX
Content Management Systems and Refactoring - Drupal, WordPress and eZ Publish
PPTX
Development environments in seconds using Bitnami containers
PPT
Open Audit
KEY
The Architect Way
PPTX
C#: Past, Present and Future
PPTX
Wintellect - Devscovery - Portable Class Library
Php on Windows
Continuous Integration In A PHP World
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
Configuration manager presentation
PHP Unconference Continuous Integration
Continuous Integration at Mollie
How bigtop leveraged docker for build automation and one click hadoop provis...
321 codeincontainer brewbox
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Portable infrastructure with puppet
How bigtop leveraged docker for build automation and one click hadoop provis...
Get acquainted with the new ASP.Net 5
A Lap Around Visual Studio 11
Vagrant to-aws-flow
Content Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Development environments in seconds using Bitnami containers
Open Audit
The Architect Way
C#: Past, Present and Future
Wintellect - Devscovery - Portable Class Library

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Empathic Computing: Creating Shared Understanding
PDF
cuic standard and advanced reporting.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
A Presentation on Artificial Intelligence
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Cloud computing and distributed systems.
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
Electronic commerce courselecture one. Pdf
Encapsulation_ Review paper, used for researhc scholars
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Advanced methodologies resolving dimensionality complications for autism neur...
Per capita expenditure prediction using model stacking based on satellite ima...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Programs and apps: productivity, graphics, security and other tools
Unlocking AI with Model Context Protocol (MCP)
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Spectroscopy.pptx food analysis technology
Empathic Computing: Creating Shared Understanding
cuic standard and advanced reporting.pdf
Assigned Numbers - 2025 - Bluetooth® Document
The Rise and Fall of 3GPP – Time for a Sabbatical?
The AUB Centre for AI in Media Proposal.docx
A Presentation on Artificial Intelligence
Chapter 3 Spatial Domain Image Processing.pdf
Cloud computing and distributed systems.
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Spectral efficient network and resource selection model in 5G networks

PHP, Cloud And Microsoft Symfony Live 2010

  • 1. Cloud and evolutions of the Microsoft platform What’s new for Open Source, PHP and Cloud Computing in the Microsoft environment. Pierre Couzy - Microsoft Laurent Bonnet - Microsoft
  • 2. Agenda • The (relatively) new Microsoft/OSS story • A new PHP platform on Windows • Running PHP on Windows • PHP apps on Windows • Opening Windows products to PHP • Cloud story : PHP on Windows Azure • The Why • The How
  • 3. Introduction PHP on Windows : • Has been around for a decade • Actually, most PHP development is done on Windows • And yet, the Microsoft-PHP story has been difficult for years.
  • 4. Open Source at Microsoft ? Open Source Technology Center 3 goals : I. Get Involved with Open Source communities II. Ensure major projects run correctly on the Windows Operating Systems III. Open our products and platform to non- Microsoft stacks
  • 5. OSTC : in the early days … Founded in 2004 2 computers One guy…
  • 6. OSTC today • Hosted in Redmond • Staffed by OSS and Linux experts • 300 servers of varying types • 340+ Linux distros available for testing • Tests interoperability of OSS and Windows • Research of OSS technologies
  • 8. A SQL Server driver for PHP ? • Done in collaboration with the PHP community • Published on CodePlex with an OSI-approved license (http://sqlsrvphp.codeplex.com/). • Can access any Sql Server instance (Express, 2005, 2008, 2008 R2, Azure) from PHP • Work in progress : enable Sql Server access to major PHP projects & frameworks
  • 10. OSTC has changed Microsoft • We contributed to the linux kernel • GPL developers do exist in Redmond • On-going collaboration • With the Apache Software Foundation • With communities • There’s still room for improvement • A typical project is still 1 month dev, 3 months stabilization, 1 year legal…
  • 11. Agenda • The (relatively) new Microsoft/OSS story • A new PHP platform on Windows • Running PHP on Windows • PHP apps on Windows • Opening Windows products to PHP • Cloud story : PHP on Windows Azure • The Why • The How
  • 12. A PHP Windows platform ? • Application: PHP • DB: SQL Server, MySql, etc. • Web Server: Internet Information Services (IIS) • OS: Windows Server 2008 / 2008 R2
  • 13. From CGI to FastCGI One request, One PHP runtime lives PHP runtime CGI ISAPI FastCGI process in IIS or in a handled by a surrogate process process pool The good The good • Very stable The good • Very fast • Faster than CGI The bad The bad • More robust than ISAPI • *SLOW* on Windows (spawning a new • Stability • No more threading process) • Thread safety issues
  • 14. Démo
  • 15. Also available on Server Core • A “distro” that minimizes footprint and attack surface • PHP runs on Server Core since Windows Server 2008
  • 16. Creating a new Build Process Using better tools to do a better job Unix ‘configure’-style makefiles Created a clean, unified build • Makefiles are generated using Unix-style •Using tools built by the OSTC, we have constructed a configure scripts. Functionality is emulated with better build process which opens many new JScript possibilities, yet can easily adapt to new changes by developers using older technologies. No Optimizations One unified set of properties • Makefiles are generated with no ability to •Generated project files use a single set of build optimize entire builds, nor take advantage of configuration files, allowing 100% of the code to be better tools, compilers, etc. built to the same specifications. Independent Dependencies Optimizations everywhere • Libraries never compiled with the same •The new process lets us take advantage of high- settings. performance PGO technology to improve the performance of PHP by leaps and bounds. Undefined process Limitless opportunities • Very few people had all the right bits/tools to •With the new process, we can now do instrumented even compile the Windows PHP binaries— builds of the entire stack, allowing us to analyze and Certainly impossible to replicate an exact build. improve PHP for any environment.
  • 17. Using VC 9 What a difference the compiler makes VC 6 builds VC 9 builds • Visual C++ 6.0, being over a decade old, • Visual C++ 9.0 provides technologies that would not produce code optimized for allow us to target today’s operating modern operating systems and systems and hardware. hardware. New Compiler Older Compiler • By just changing the compiler, generates • PHP on Windows was being left behind, code that performs better, even before simply because it was nearly impossible using advanced PGO technologies. to build with any other compiler Now, 64 bit support No 64 bit support • We are now building 64bit snapshot • VC 6 offered no ability to build for 64 bit builds alongside the 32 bit builds, 95%+ Windows libraries are 64 bit too.
  • 18. Going native Using Windows APIs on Windows… Eliminated POSIX emulation Heavy use of POSIX emulation • Dropped the POSIX emulation libraries, and • PHP has been built with POSIX in mind, and code has been written to use Win32 APIs therefore, on Windows it was natural to adopt correctly. emulation libraries to accomplish similar tasks. Choosing the Win32 Way Using wrong methods • Implemented features in a way that doesn’t • Often, the way to do something on Unix, is not mimic the method on Unix, just the results. the way to do it on Windows. Use native libraries/APIs Non-standard Implementations • Replaced that code with calls to the natively • Many libraries were being used to supply provided APIs. functionality that was already present in Windows (Crypto, DNS, etc) Targets new OS, gracefully Targeted oldest OS possible • Recent code changes now allow us to target features on the latest versions of Windows, and • Windows 98 was considered a primary target… provides graceful failure on down-level ‘nuff said! platforms.
  • 19. Testing and QA Using Windows APIs on Windows… Unix was the primary platform Windows is a primary platform • If it worked on a Unix platform, it was done... Windows was never given any attention, nor •Windows is now a primary platform, and changes care by hardly anyone which break Windows must be addressed. 98%+ tests now pass on Windows. Tests did not have high pass rate. •Over 98% of tests now pass on Windows, and we’re • The standard PHP test suite did not pass with a aiming to close the gap completely. strong success rate. Windows is now represented Security was a Unix concern. •Windows developers are now on the security mailing • Security considerations for Windows were not lists, and can take action at the same time. taking place, no Windows developers were on the Security Mailing Lists New Testing Tools •The OSTC has created new tools for testing FastCGI No tools for doing automated testing. and PHP builds that can be included in the official build process, providing PGO and instrumentation • Nearly no tools to assist in automation of data to the developers. testing on Windows at all.
  • 20. Release Process Same Day Service…with a smile Windows is a primary platform Unix was the primary platform • Windows gets the same ability to push • Unix Platforms was the only concern. back on Release Dates, and builds are done on both platforms on the same day. Single point of failure. Easy to replicate. • Builds for Windows were constrained by a single person’s ability to make the build • It is now simple for anyone to rebuild the happen. exact same PHP stack on Windows as the release build. No attention to details. New work on the installer. • Hardly anyone worked on Windows releases, and the installer was poor. • New work is being done to improve the installer for the Windows platform.
  • 21. Where are we now ? • PHP is at last maintained on Windows. • And ready for production • http://windows.php.net • Performance tuning is on its way • We are getting on par with LAMP • Ongoing work on caching • We still lack many modules for 5.3 • That’s our top priority right now
  • 22. Web Plaform Installer http://www.microsoft.com/web • A tool to install and configure • IIS • Frameworks and runtimes (.NET / PHP) • Databases (SQL Server, MySQL) • Tools (Visual Web Developper 2008, Silverlight 3 Tools for VS) • And Web apps • Blogs (phpBB, WordPress, DasBlog, …) • Wikis, Galleries, etc. • CMS (DotNetNuke, Drupal, SilverStripe, ...)
  • 23. What’s next Windows Cache Extension 1.0 for PHP PHP Connectivity to Windows Azure Word and Excel reading and writing Windows Live services PDO Driver for Sql Server … Working in sync with you on the most popular applications
  • 25. Agenda • The (relatively) new Microsoft/OSS story • A new PHP platform on Windows • Running PHP on Windows • PHP apps on Windows • Opening Windows products to PHP • Cloud story : PHP on Windows Azure • The Why • The How
  • 26. Cloud terms & actors in a nutshell • Infrastructure as a Service : bring your OS • Platform as a service : bring your App • Infrastructure as a service : use our App
  • 27. How does your app handle load ? peak load Usage Idle time Jan Apr Jul Oct Cloud Cloud p1 p2 p3 Web Tier B/L Tier Web Tier B/L Tier Database Web Tier B/L Tier Database Web Tier B/L Tier
  • 28. How does your app share data ? I love I love you! you too! Server Data Company A
  • 29. Scenarios for Data In-browser Application (JSON & AtomPub Support in Azure) Public Cloud Server Data Server Server Company B Server Data Server Company A
  • 30. Your app, my accounts ? Federated Identity Your App Your App Provider Account DB Your Your Entreprise for a web University OpenID … directory app account account
  • 31. The Windows Azure cloud infrastructure
  • 32. We Start with Lots of Blinking Lights and Cables
  • 33. We Put them Into Racks
  • 34. Then, we add software • A hypervisor, on top of which a Host Virtual Machine, on top of which many Virtual Machines CPU: x64 OS : Windows 2008 Web Server : IIS 7 Apps : .Net, PHP, C++, etc.
  • 35. Then, we add redundancy logic Front-end Node Front-end Node Front-end Node REST/SOAP REST/SOAP REST/SOAP front-end ACE Logic ACE Logic ACE Logic Data Access Library Data Access Library Data Access Library Master Cluster Service Management Health Master Node Master Node Provisioning Deployment Monitoring Partition Manager Partition Manager Data Node Data Node Components Components Data Cluster Data Node Data Node Data Node Data Node Data Node SQL SQL SQL SQL SQL Server Mgmt. Server Mgmt. Server Mgmt. Server Mgmt. Server Mgmt. Services Services Services Services Services Fabric Fabric Fabric Fabric Fabric Fabric Fetch Partition SQL Replication Map Client
  • 37. Running code on Azure • We re-use the existing IIS infrastructure • FastCGI allows us to plug in almost every language • For example, you can package PHP, • .. Including your own extensions and configuration, • Point PHP files to PHP-CGI.exe, • .. And run them directly • Let’s see that in action.
  • 39. Data on Azure • A basic storage infrastructure : Azure Storage • Blobs (think files) • Tables (think Flat File database) • Queues (messages) • Access is done using REST • A SQL-Server engine : SQL Azure • A subset of SQL Server 2008 • Including Views, Stored Procedures, etc. • Access is done using TDS
  • 40. Using Azure Storage • http://phpazure.codeplex.com/ • Overview • Enables PHP developers to take advantage of the Microsoft Cloud Services Platform – Windows Azure. • Provides consistent programming model for Windows Azure Storage (Blobs, Tables & Queues) • Features • PHP classes for Windows Azure Blobs, Tables & Queues (for CRUD operations) • Helper Classes for HTTP transport, AuthN/AuthZ, REST & Error Management • Manageability, Instrumentation & Logging support • Support for storing PHP sessions in Azure Table Storage • Licence : BSD
  • 41. Using Sql Azure • http://www.codeplex.com/SQLSRVPHP • Licence : Microsoft Public License (Ms-PL) • Gives access to SQL Server databases, • But also SQL Azure
  • 42. Consuming Sql Azure ... in PHP … with Eclipse
  • 43. We do our best to be technology-agnostic Azure Services Platform ™
  • 45. Thank you, and stay tuned for more (Symfony on Azure ?)
  • 46. Links • www.azure .com : main entry point • http://sqlazuremw.codeplex.com/ • Migration Wizard (Sql Server -> Sql Azure) • http://www.codeplex.com/SQLSRVPHP • Accessing data using TDS (Sql Server, Sql Azure) • http://phpazure.codeplex.com/ • Accessing Azure Storage in PHP • http://windows.php.net • Latest PHP binaries & Source • http://www.microsoft.com/downloads/details.aspx?FamilyID=413E 88F8-5966-4A83-B309-53B7B77EDF78&displaylang=en • Standard Azure Training Kit, contains samples to run PHP on Azure • http://phpdataservices.codeplex.com/ • Accessing REST data using PHP