APRIL 12, 2023 | SLIDE 1
APRIL 12, 2023 | SLIDE 2
www.realdolmen.com
PHP on Windows
Maarten Balliauw – RealDolmenE-mail: [email protected]
Blog: http://blog.maartenballiauw.be Twitter: @maartenballiauw
APRIL 12, 2023 | SLIDE 3
WHO AM I?
Maarten Balliauw Antwerp, Belgium www.realdolmen.com Focus on web
ASP.NET, ASP.NET MVC, PHP, Azure, VSTS, … MVP ASP.NET
Interested in interoperability PHPExcel, PHPLinq, Windows Azure SDK for PHP, ...
http://blog.maartenballiauw.be http://twitter.com/maartenballiauw
APRIL 12, 2023 | SLIDE 4
AGENDA
Why PHP matters… An overview of initiatives
PHP core development FastCGI WinCache extension SQL Server driver for PHP Microsoft Web Platform Installer SDK’s Tooling SEO Optimization Tool
Resources Q&A
APRIL 12, 2023 | SLIDE 5
WHY PHP MATTERS…
Web applications Wordpress Drupal Joomla phpBB MediaWiki SugarCRM Gallery2
Commercial entities Yahoo! Flickr Digg Facebook YouTube Wikipedia
Hard to ignore!
APRIL 12, 2023 | SLIDE 6
PHP ON WINDOWSIf PHP matters, better make it a first-class citizen…
APRIL 12, 2023 | SLIDE 7
MICROSOFT AND THE PHP COMMUNITY
BeforeNo Core developer working on or for Windows
Windows was a 2nd class platform
Binaries releases days or weeks after the sources releases
Absence QA on Windows
Lack of documentation and communication
NowCreation of the Windows Internals Team
•2 core developers•7 regular helpers, contributors or testers (growing)
Windows is now a primary platform
Synchronized releases•5.2.6, 5.2.7, 5.2.8, 5.3.0 beta
QA on Windows•95% of the core tests pass on Windows
Dedicated communication channels
•Mailing list, Windows internal list, iis.net/php(http://www.php.net/mailing-lists.php)•IRC channel on freenode #php-dev-win
APRIL 12, 2023 | SLIDE 8
HTTP://WINDOWS.PHP.NET
APRIL 12, 2023 | SLIDE 9
PHP 5.3 ON WINDOWS
Is 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 scratch Top PHP Windows community programmer working for
Microsoft (Pierre Joye) Build with VS 2008 Available in 32 and 64 bit version Created windows.php.net 99% of all POSIX calls changed to native Windows calls
APRIL 12, 2023 | SLIDE 10
BY THE NUMBERS: RUNNING PHPBENCH LOOPED 5X Both computers are a HP 8 core (2 procs x Quad core)
16gb ram. Linux (Centos 5.2) vs. Windows Server 2008 x86
NOTE: phpbench onlytests internal PHP engineperformance. It doesnot do IO of any kind.
Windows 5.2 Linux 5.2 Linux 5.3 Optimized
Windows 5.3 Windows 5.3 Optimized
0
5
10
15
20
25
30
3530.194
27.9609999999999
20.1140000000001 19.985
16.436
PHPBench 5x Looped Run In Seconds
Time
APRIL 12, 2023 | SLIDE 11
FASTCGI ON IISHow and where will my application run?
APRIL 12, 2023 | SLIDE 12
PHP ON WINDOWS – HISTORY
IIS support has been there for a long time Apache runs on Windows as well
But… IIS gives best performance on Windows Unfortunately the choice was always between stability and
performance…
APRIL 12, 2023 | SLIDE 13
ALLOW ME TO EXPLAIN…
CG
I A new php.exe process for every requestAdvantage• Very stable!
Disadvantage• Slow due to I/O
overhead of process creation on Windows
ISA
PI PHP loaded as an extension in IIS’ memory spaceAdvantage• Better
performance
Disadvantage• Not that stable…• Many PHP
extensions are not thread safe
APRIL 12, 2023 | SLIDE 14
AND ALONG CAME IMPROVEMENT!C
GI A new php.exe
process for every requestAdvantage• Very stable!Disadvantage• Slow due to I/O
overhead of process creation on Windows
ISA
PI PHP loaded as
an extension in IIS’ memory spaceAdvantage• Better
performanceDisadvantage• Not that stable…• Many PHP
extensions are not thread safe
Fast
CG
I Process caching and pooling mechanismAdvantage• Faster than CGI• More Stable than
ISAPI• Can run non-
thread-safe versions of PHP extensions
APRIL 12, 2023 | SLIDE 15
FASTCGI
APRIL 12, 2023 | SLIDE 16
DEMOFastCGI on IIS
APRIL 12, 2023 | SLIDE 17
IIS EXECUTION PIPELINE
Since 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 there
ASP.NET membership / authentication Output caching …
APRIL 12, 2023 | SLIDE 18
WINCACHE EXTENSIONMaking it even faster…
APRIL 12, 2023 | SLIDE 19
WINDOWS CACHE EXTENSION (“WINCACHE”)
PHP module for 5.2 and 5.3 IIS specific PHP accelerator
So only works in IIS!
No code modifications needed in your application Cache layers:
Bytecode cache – Caches compiled PHP scripts Script cache – Cache script sources in memory to reduce I/O
access and UNC file share access Relative file path cache – Caches relative file path Session cache – Sessions stored in shared memory
PHP functions to obtain information about the cache status
http://www.iis.net/download/WinCacheForPhp
APRIL 12, 2023 | SLIDE 20
DEMOWinCache extension
APRIL 12, 2023 | SLIDE 21
SQL SERVER DRIVER FOR PHP
Data access should be fast as well!
APRIL 12, 2023 | SLIDE 22
SQL SERVER DRIVER FOR PHP V1.1
PHP extension for Windows So only works on Windows!
Reliable, scalable and fast integration with SQL Server for PHP
Relies on the Microsoft SQL Server Native Client to communicate with SQL Server.
http://bit.ly/cwDLR1
APRIL 12, 2023 | SLIDE 23
“Did you just forgetto mention PDO support?”
APRIL 12, 2023 | SLIDE 24
NO, THERE IS NO PDO SUPPORT. OH, WAIT!
Unless you want the new CTP bits!
SQL Server Driver for PHP v2.0 CTP Support for PHP Data Objects (PDO) Better UTF-8 support Example: Drupal 7 on SQL Server
http://www.commerceguys.com/about/news/drupal-7-sql-server-preview
http://bit.ly/cjGvO3
APRIL 12, 2023 | SLIDE 25
HERE ARE YOUR OPTIONS!
APRIL 12, 2023 | SLIDE 27
MICROSOFT WEB PLATFORM INSTALLER
“Yum for Windows”?
APRIL 12, 2023 | SLIDE 28
EASY INSTALLATION OF YOUR ENVIRONMENT
Easy installer providing Platform installation (IIS, extra modules, configuration, …)
Both ASP.NET and PHP Application installation
Both ASP.NET and PHP
http://microsoft.com/web
APRIL 12, 2023 | SLIDE 29
DEMOWeb Platform Installer
APRIL 12, 2023 | SLIDE 30
SDK’SWhat else is out there?
APRIL 12, 2023 | SLIDE 31
MICROSOFT AND PHP = LOTS OF GOODIES
Some highlights… SQL Server Reporting Services SDK for PHP OData SDK for PHP Windows Azure Tools for Eclipse Windows Azure SDK for PHP AppFabric SDK for PHP Windows Azure Command-Line Tools for PHP Eclipse Tools for Silverlight Information Cards for PHP Internet Explorer Webslices and Accelerators for PHP PHP and Silverlight SQL CRUD Application Wizard for PHP Toolkit for PHP and Bing Maps
Overview: http://www.interoperabilitybridges.com/
APRIL 12, 2023 | SLIDE 32
SQL Server Reporting Services SDK for PHP
SSRS? Reporting tool in SQL Server Very powerful! Various output formats Can be linked to MySQL, PostgreSQL, …
API to interoperate with SQL Server Reporting Services List available reports within a PHP applications, Provide custom parameters from a PHP web form, Manage the rendering of the reports within a PHP application
http://ssrsphp.codeplex.com
APRIL 12, 2023 | SLIDE 33
OData SDK for PHP
OData? Open Data Protocol Unlock your data and free it from silos that exist in applications
today Builds on HTTP, AtomPub and JSON RESTful interface Way data is delivered in MS CN “Dallas”
API to OData Generate proxy classes to OData feeds CRUD on OData feeds
http://odataphp.codeplex.com/
APRIL 12, 2023 | SLIDE 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();
APRIL 12, 2023 | SLIDE 35
Windows Azure
Microsoft’s Cloud Computing offering Web/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 PHP Windows Azure Tools for Eclipse Windows Azure SDK for PHP AppFabric SDK for PHP Windows Azure Command-Line Tools for PHP Zend Framework contribution
APRIL 12, 2023 | SLIDE 36
TOOLINGHow do I use all this?
APRIL 12, 2023 | SLIDE 37
MICROSOFT EXPRESSION WEB
APRIL 12, 2023 | SLIDE 38
WINDOWS AZURE TOOLS FOR ECLIPSE
APRIL 12, 2023 | SLIDE 39
SILVERLIGHT TOOLS FOR ECLIPSE
APRIL 12, 2023 | SLIDE 40
SEO OPTIMIZATION TOOL
APRIL 12, 2023 | SLIDE 41
What’s in the cloud?RESOURCESWhere can I learn more?
APRIL 12, 2023 | SLIDE 42
RESOURCES
Microsoft Windows Azure Interop http://www.microsoft.com/windowsazure/interop/
Interop Bridges http://www.interoperabilitybridges.com/
APRIL 12, 2023 | SLIDE 43
SUMMARY
PHP on Windows is a priority for Microsoft Full range of PHP support Products and Services Attract more customers to the MS platform through
world-class support and resources Microsoft wants you to succeed
APRIL 12, 2023 | SLIDE 44
QUESTIONSPossibly Answers
APRIL 12, 2023 | SLIDE 45
THANK YOU!
Maarten Balliauwhttp://blog.maartenballiauw.be