SlideShare a Scribd company logo
PHP on Windows
PHP on WindowsMaarten Balliauw – RealDolmenE-mail: maarten.balliauw@realdolmen.comBlog: http://blog.maartenballiauw.beTwitter: @maartenballiauw
Who am I?Maarten BalliauwAntwerp, Belgiumwww.realdolmen.comFocus on webASP.NET, ASP.NET MVC, PHP, Azure, VSTS, …MVP ASP.NETInterested in interoperabilityPHPExcel, PHPLinq, Windows Azure SDK for PHP, ...http://blog.maartenballiauw.behttp://twitter.com/maartenballiauw
AgendaWhy PHP matters…An overview of initiativesPHP core developmentFastCGIWinCache extensionSQL Server driver for PHPMicrosoft Web Platform InstallerSDK’sToolingSEO Optimization ToolResourcesQ&A
Why PHP matters…Web applicationsWordpressDrupalJoomlaphpBBMediaWikiSugarCRMGallery2Commercial entitiesYahoo!FlickrDiggFacebookYouTubeWikipedia Hard to ignore!
PHP on WindowsIf PHP matters, better make it a first-class citizen…
Microsoft and the PHP CommunityBeforeNow
http://windows.php.net
PHP 5.3 on WindowsIs the most significant update to PHP on Windows!All libraries updated to latest versions(in some cases newer versions that used on Linux)Re-write of the build system from scratchTop PHP Windows community programmer working for Microsoft (Pierre Joye)Build with VS 2008Available in 32 and 64 bit versionCreated windows.php.net99% of all POSIX calls changed to native Windows calls
By the numbers: Running PHPBench looped 5xBoth computers are a HP 8 core (2 procs x Quad core) 16gb ram.Linux (Centos 5.2) vs. Windows Server 2008 x86NOTE: phpbench onlytests internal PHP engineperformance. It doesnot do IO of any kind.
FastCGI on IISHow and where will my application run?
PHP on Windows – HistoryIIS support has been there for a long timeApache runs on Windows as wellBut…IIS gives best performance on WindowsUnfortunately the choice was always between stability and performance…
Allow me to explain…
And along came improvement!
FastCGI
DemoFastCGI on IIS
IIS execution pipelineSince your PHP app is part of the IIS execution pipeline……you can use IIS URL rewriting…you can use IIS as a load balancer (ARR)www.viprive.com…you can use any HttpModule out thereASP.NET membership / authenticationOutput caching…
WinCache extensionMaking it even faster…
Windows Cache Extension (“WinCache”)PHP module for 5.2 and 5.3IIS specific PHP acceleratorSo only works in IIS!No code modifications needed in your applicationCache layers:Bytecode cache – Caches compiled PHP scriptsScript cache – Cache script sources in memory to reduce I/O access and UNC file share accessRelative file path cache – Caches relative file pathSession cache – Sessions stored in shared memoryPHP functions to obtain information about the cache statushttp://www.iis.net/download/WinCacheForPhp
DemoWinCache extension
SQL Server Driver for PHPData access should be fast as well!
SQL Server Driver for PHP v1.1PHP extension for WindowsSo only works on Windows!Reliable, scalable and fast integration with SQL Server for PHPRelies on the Microsoft SQL Server Native Client to communicate with SQL Server.http://bit.ly/cwDLR1
“Did you just forgetto mention PDO support?”
No, there is no PDO support. Oh, wait!Unless you want the new CTP bits!SQL Server Driver for PHP v2.0 CTPSupport for PHP Data Objects (PDO)Better UTF-8 supportExample: Drupal 7 on SQL Serverhttp://www.commerceguys.com/about/news/drupal-7-sql-server-previewhttp://bit.ly/cjGvO3
Here are your options!
DemoSQL Server Driver for PHP
Microsoft Web Platform Installer“Yum for Windows”?
Easy installation of YOUR environmentEasy installer providingPlatform installation (IIS, extra modules, configuration, …)Both ASP.NET and PHPApplication installationBoth ASP.NET and PHPhttp://microsoft.com/web
DemoWeb Platform Installer
SDK’sWhat else is out there?
Microsoft and PHP = LOTS of goodiesSome highlights…SQL Server Reporting Services SDK for PHPOData SDK for PHPWindows Azure Tools for EclipseWindows Azure SDK for PHPAppFabric SDK for PHPWindows Azure Command-Line Tools for PHPEclipse Tools for SilverlightInformation Cards for PHPInternet Explorer Webslices and Accelerators for PHPPHP and SilverlightSQL CRUD ApplicationWizard for PHP Toolkit for PHP and Bing MapsOverview: http://www.interoperabilitybridges.com/
SQL Server Reporting Services SDK for PHPSSRS?Reporting tool in SQL ServerVery powerful!Various output formatsCan be linked to MySQL, PostgreSQL, …API to interoperate with SQL Server Reporting ServicesList available reports within a PHP applications,Provide custom parameters from a PHP web form,Manage the rendering of the reports within a PHP applicationhttp://ssrsphp.codeplex.com
OData SDK for PHPOData?Open Data ProtocolUnlock your data and free it from silos that exist in applications todayBuilds on HTTP, AtomPub and JSONRESTful interfaceWay data is delivered in MS CN “Dallas”API to ODataGenerate proxy classes to OData feedsCRUD on OData feedshttp://odataphp.codeplex.com/
OData SDK for PHP/* connect to the OData service  */   $svc = new NorthwindEntities(NORTHWIND_SERVICE_URL);/* get the list of Customers in the USA +the list of Orders */    $query = $svc->Customers()                 ->filter("Country eq 'USA'")                 ->Expand('Orders');    $customerResponse = $query->Execute();/* get only CustomerID and CustomerName */    $query = $svc->Customers()                 ->filter("Country eq 'USA'")                 ->Select('CustomerID, CustomerName');    $customerResponse = $query->Execute();/* create a new customer */    $customer = Customers::CreateCustomers('channel9', 'CHAN9');    $proxy->AddToCustomers($customer); /* commit the change on the server */            $proxy->SaveChanges();
Windows AzureMicrosoft’s Cloud Computing offeringWeb/worker role (= virtual machine)Blobs, tables, queues, drives (= storage)SQL Azure (= +/- SQL Server)AppFabric (= access control & firewall punching)“Dallas” (= Data-as-a-Service)Working with PHPWindows Azure Tools for EclipseWindows Azure SDK for PHPAppFabric SDK for PHPWindows Azure Command-Line Tools for PHPZend Framework contribution
ToolingHow do I use all this?
Microsoft Expression Web
Windows Azure Tools for Eclipse
Silverlight Tools for Eclipse
SEO Optimization Tool
What’s in the cloud?ResourcesWhere can I learn more?
ResourcesMicrosoft Windows Azure Interophttp://www.microsoft.com/windowsazure/interop/InteropBridgeshttp://www.interoperabilitybridges.com/
SummaryPHP on Windows is a priority for MicrosoftFull range of PHP support Products and ServicesAttract more customers to the MS platform through world-class support and resources Microsoft wants you to succeed
QuestionsPossibly Answers

More Related Content

PHP on Windows

  • 2. PHP on WindowsMaarten Balliauw – RealDolmenE-mail: maarten.balliauw@realdolmen.comBlog: http://blog.maartenballiauw.beTwitter: @maartenballiauw
  • 3. Who am I?Maarten BalliauwAntwerp, Belgiumwww.realdolmen.comFocus on webASP.NET, ASP.NET MVC, PHP, Azure, VSTS, …MVP ASP.NETInterested in interoperabilityPHPExcel, PHPLinq, Windows Azure SDK for PHP, ...http://blog.maartenballiauw.behttp://twitter.com/maartenballiauw
  • 4. AgendaWhy PHP matters…An overview of initiativesPHP core developmentFastCGIWinCache extensionSQL Server driver for PHPMicrosoft Web Platform InstallerSDK’sToolingSEO Optimization ToolResourcesQ&A
  • 5. Why PHP matters…Web applicationsWordpressDrupalJoomlaphpBBMediaWikiSugarCRMGallery2Commercial entitiesYahoo!FlickrDiggFacebookYouTubeWikipedia Hard to ignore!
  • 6. PHP on WindowsIf PHP matters, better make it a first-class citizen…
  • 7. Microsoft and the PHP CommunityBeforeNow
  • 9. PHP 5.3 on WindowsIs the most significant update to PHP on Windows!All libraries updated to latest versions(in some cases newer versions that used on Linux)Re-write of the build system from scratchTop PHP Windows community programmer working for Microsoft (Pierre Joye)Build with VS 2008Available in 32 and 64 bit versionCreated windows.php.net99% of all POSIX calls changed to native Windows calls
  • 10. By the numbers: Running PHPBench looped 5xBoth computers are a HP 8 core (2 procs x Quad core) 16gb ram.Linux (Centos 5.2) vs. Windows Server 2008 x86NOTE: phpbench onlytests internal PHP engineperformance. It doesnot do IO of any kind.
  • 11. FastCGI on IISHow and where will my application run?
  • 12. PHP on Windows – HistoryIIS support has been there for a long timeApache runs on Windows as wellBut…IIS gives best performance on WindowsUnfortunately the choice was always between stability and performance…
  • 13. Allow me to explain…
  • 14. And along came improvement!
  • 17. IIS execution pipelineSince your PHP app is part of the IIS execution pipeline……you can use IIS URL rewriting…you can use IIS as a load balancer (ARR)www.viprive.com…you can use any HttpModule out thereASP.NET membership / authenticationOutput caching…
  • 19. Windows Cache Extension (“WinCache”)PHP module for 5.2 and 5.3IIS specific PHP acceleratorSo only works in IIS!No code modifications needed in your applicationCache layers:Bytecode cache – Caches compiled PHP scriptsScript cache – Cache script sources in memory to reduce I/O access and UNC file share accessRelative file path cache – Caches relative file pathSession cache – Sessions stored in shared memoryPHP functions to obtain information about the cache statushttp://www.iis.net/download/WinCacheForPhp
  • 21. SQL Server Driver for PHPData access should be fast as well!
  • 22. SQL Server Driver for PHP v1.1PHP extension for WindowsSo only works on Windows!Reliable, scalable and fast integration with SQL Server for PHPRelies on the Microsoft SQL Server Native Client to communicate with SQL Server.http://bit.ly/cwDLR1
  • 23. “Did you just forgetto mention PDO support?”
  • 24. No, there is no PDO support. Oh, wait!Unless you want the new CTP bits!SQL Server Driver for PHP v2.0 CTPSupport for PHP Data Objects (PDO)Better UTF-8 supportExample: Drupal 7 on SQL Serverhttp://www.commerceguys.com/about/news/drupal-7-sql-server-previewhttp://bit.ly/cjGvO3
  • 25. Here are your options!
  • 27. Microsoft Web Platform Installer“Yum for Windows”?
  • 28. Easy installation of YOUR environmentEasy installer providingPlatform installation (IIS, extra modules, configuration, …)Both ASP.NET and PHPApplication installationBoth ASP.NET and PHPhttp://microsoft.com/web
  • 30. SDK’sWhat else is out there?
  • 31. Microsoft and PHP = LOTS of goodiesSome highlights…SQL Server Reporting Services SDK for PHPOData SDK for PHPWindows Azure Tools for EclipseWindows Azure SDK for PHPAppFabric SDK for PHPWindows Azure Command-Line Tools for PHPEclipse Tools for SilverlightInformation Cards for PHPInternet Explorer Webslices and Accelerators for PHPPHP and SilverlightSQL CRUD ApplicationWizard for PHP Toolkit for PHP and Bing MapsOverview: http://www.interoperabilitybridges.com/
  • 32. SQL Server Reporting Services SDK for PHPSSRS?Reporting tool in SQL ServerVery powerful!Various output formatsCan be linked to MySQL, PostgreSQL, …API to interoperate with SQL Server Reporting ServicesList available reports within a PHP applications,Provide custom parameters from a PHP web form,Manage the rendering of the reports within a PHP applicationhttp://ssrsphp.codeplex.com
  • 33. OData SDK for PHPOData?Open Data ProtocolUnlock your data and free it from silos that exist in applications todayBuilds on HTTP, AtomPub and JSONRESTful interfaceWay data is delivered in MS CN “Dallas”API to ODataGenerate proxy classes to OData feedsCRUD on OData feedshttp://odataphp.codeplex.com/
  • 34. OData SDK for PHP/* connect to the OData service */ $svc = new NorthwindEntities(NORTHWIND_SERVICE_URL);/* get the list of Customers in the USA +the list of Orders */ $query = $svc->Customers() ->filter("Country eq 'USA'") ->Expand('Orders'); $customerResponse = $query->Execute();/* get only CustomerID and CustomerName */ $query = $svc->Customers() ->filter("Country eq 'USA'") ->Select('CustomerID, CustomerName'); $customerResponse = $query->Execute();/* create a new customer */ $customer = Customers::CreateCustomers('channel9', 'CHAN9'); $proxy->AddToCustomers($customer); /* commit the change on the server */ $proxy->SaveChanges();
  • 35. Windows AzureMicrosoft’s Cloud Computing offeringWeb/worker role (= virtual machine)Blobs, tables, queues, drives (= storage)SQL Azure (= +/- SQL Server)AppFabric (= access control & firewall punching)“Dallas” (= Data-as-a-Service)Working with PHPWindows Azure Tools for EclipseWindows Azure SDK for PHPAppFabric SDK for PHPWindows Azure Command-Line Tools for PHPZend Framework contribution
  • 36. ToolingHow do I use all this?
  • 38. Windows Azure Tools for Eclipse
  • 41. What’s in the cloud?ResourcesWhere can I learn more?
  • 42. ResourcesMicrosoft Windows Azure Interophttp://www.microsoft.com/windowsazure/interop/InteropBridgeshttp://www.interoperabilitybridges.com/
  • 43. SummaryPHP on Windows is a priority for MicrosoftFull range of PHP support Products and ServicesAttract more customers to the MS platform through world-class support and resources Microsoft wants you to succeed