SydPHP
 March 2012
  Meetup
Agenda
Brad Lorge (that guy)
- Javascript, security, and more
Mini-Break



Graham Weldon (me)
- Web server alternatives
- Environment setup

Post-meetup social gathering
  (Yep, Geeks can socialise too!)
Last Month
Social Event

Drinks and Dinner

Team Building Exercises

Lots of Fun

Gathered some ideas

We’ve got lots planned for 2012!
Some drinks and dinner
And some team building
Sponsorship
We need your help!

Working for a web company?

Let them know about our sponsorship packages

Help support our community

Come and chat to me:
     during the break

     and after the meetup
Talks and Topics
Again, come and speak to me

Or contact us via the website: http://
sydphp.org

Or contact us via twitter! @sydphp

Or contact us via Email!
organisers@sydphp.org

Or contact us on Facebook! Group: SydPHP
Talk Time!
Brad Lorge
Take a break!
10 minutes or so..
                                   Sponsors
Have a think about sponsoring
SydPHP

Consider talk topics you want to
hear about

Do you want to give a talk? We’d
love to hear about it!

Got any ideas for SydPHP? Let us
know!

Don’t forget to check in on
Meetup.com to say you are here!
Talk Time!
Graham Weldon
Environment
Alternatives
Some of the options
Some of the reasons
Web Servers
For serving.. the web.
Get it right
Web servers should serve static content

Hand off to a PHP processor to handle PHP
          Client    Web      PHP
         Request   Server   Handler




There is so much more

Caching, Tagging, proxying, reverse
Client Request   Web Server   PHP Handler
Client
Request




            Web      PHP
           Server   Handler




  Load      Web      PHP
Balancer   Server   Handler




            Web      PHP
           Server   Handler
Client
Request




                                    PHP
            Web     Process
                              PHP
           Server   Manager
                                    PHP


                                    PHP
  Load      Web     Process
Balancer   Server   Manager   PHP
                                    PHP


                                    PHP
            Web     Process
           Server   Manager   PHP
                                    PHP
Client
Request




                                    PHP
            Web     Process
                              PHP
           Server   Manager
                                    PHP


                                    PHP
  Load      Web     Process
Balancer   Server   Manager   PHP
                                    PHP


                                    PHP
            Web     Process
           Server   Manager   PHP
                                    PHP
Client
Request




  Load
Balancer
Web
           Server




  Load      Web
Balancer   Server




            Web
           Server
Web     Process
Server   Manager
PHP
Process
          PHP
Manager
                PHP
Popular Web Servers              (Some of them)




Apache

IIS

Nginx

Google Web Server

Resin

Lighttpd
Ordered by popularity based on netcraft survey stats, 2012
Popular Web Servers
                (Some of them)




Apache

Nginx

IIS

Google Web Server

Resin

Lighttpd
Popular PHP approaches
                  (Some of them)




 mod_php (Apache)

 FastCGI

 PHP-FPM

 PHP Builtin Server ?
Apache
mod_php
 Old faithful
Apache + mod_php

Loaded as an Apache Module

Apache becomes capable of interpreting PHP
files

Part of the rendering process hooks
mod_php

Output served as normal
Apache
mod_fastcgi
  Old. Faithful?
Apache + mod_fastcgi

Just because it includes “fast” in its name ...

Allows passing requests matching rules to an
external process

Passes filename for execution

Loads configuration on each access (slower)
Nginx
PHP-FPM
New, awesome!
(in my opinion)
Information
            Appliances
          A term coined by Jef Raskin, 1979

“Designed and pre-configured for a single application”
Nginx

Some background
Nginx

Event based

Non-blocking

Asynchronous request handling

Single thread

Designed for speed
Nginx


Proxying built in

Proxy requests off to external processes

Network, or unix socket
Nginx + PHP-FPM

Nginx serves static content (fast)

PHP-FPM handles launching processes for
PHP

Loads config once

PHP managed separately from Webserver

Pool management
Thanks!!

SydPHP March 2012 Meetup