SlideShare a Scribd company logo
mod_php
vs PHP CLI
vs FastCGI
vs FPM
@jacques_thekit
• Graphic designer turned programmer
• PHP/JS Developer 10 years
experience
• Have worked in Python, ActionScript,
ColdFusion, others…
• Big community supporter
• Co-author of virtPHP
The beard is on the
way back
Who am I?
Some Questions:
Do you know?
Some house keeping
What is a process?
A process is
A process is
An app answering
a request
Request
App
Response
A thread is
An task requested
by a process
Request
Process
Response
Thread Thread Thread
What is PHP, really?
C Binary
C Binary
Computer
C Binary
Computer
Request
?
C Binary
Computer
Request
Server
Port
Ready to keep diving?
That was the easy part.
How does our
server talk to PHP?
C Binary
SAPI
SAPI: Server Application Interface
C Binary
mod_php
FPMCLI
http://www.slideshare.net/auroraeosrose/php-extensions-45834933
Even
extensions
What are the types?
The rabbit hole keeps going.
mod_php FastCGI FPM CLI
And Others
Starting with CGI
Applies both to CGI and FPM
C Binary
Computer
Request
Computer
Request
CGI isolates requests to “locked down” environments
Computer
Request
FastCGI
FastCGI acts as interface to CGI and script
Computer
Request
FPM
FPM = FastCGI Process Manager
How is mod_php
different?
Apache baby!
mod_php
apache
Request
apache ≠ CGI
apache = web server
and so is nginx
nginx vs apache
This rabbit needs some white gloves
apache mpm_prefork
apache
apache
Request
apache
Request
Request
apache
Request
nginx
Request Request
nginx
Request Request
Request
nginx
Request
Request
Request
nginx
Request
Request
apache
Request
PHP PHP PHP PHP PHP
apache
PHP PHP PHP PHP PHP
nginx
Request Request
PHP
apache
PHP PHP PHP PHP PHP
nginx
Static
Dynamic
Reverse
Proxy
Are we done?
sum that up for me
The types of PHP are just
APIs for web servers to
interface with PHP
The web server you use
will most likely determine
what type of PHP to use.
You should consider
your needs before
picking which version
of PHP to use.
What about CLI?
CLI is command line SAPI
you know $ php…
$ php -a access interactive shell
$ php -r “echo ‘hi’”;
hi
$ php your_file.php
virtPHP
mod_php
vs PHP CLI
vs FastCGI
vs FPM
@jacques_thekit
Resources
https://www.digitalocean.com/community/tutorials/apache-vs-nginx-practical-
considerations
http://www.php-cli.com
http://php-fpm.org
http://php.net/manual/en/install.fpm.php
http://www.fastcgi.com/drupal/node/5?q=node/10
http://www.suphp.org/Home.htmlt
http://www.sitepoint.com/setting-up-php-behind-nginx-with-fastcgi/
https://www.chriswiegman.com/2011/10/fastcgi-vs-suphp-vs-cgi-vs-mod_php-
dso/
mod_php
vs PHP CLI
vs FastCGI
vs FPM
@jacques_thekit

More Related Content

What's hot

Supply Chain Optimization Projects
Supply Chain Optimization ProjectsSupply Chain Optimization Projects
Supply Chain Optimization Projects
Antonio Quadros
 
Entity framework code first
Entity framework code firstEntity framework code first
Entity framework code first
Confiz
 

What's hot (20)

Ehcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEhcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage Patterns
 
Node.js Express
Node.js  ExpressNode.js  Express
Node.js Express
 
SFDC Batch Apex
SFDC Batch ApexSFDC Batch Apex
SFDC Batch Apex
 
Supply Chain Optimization Projects
Supply Chain Optimization ProjectsSupply Chain Optimization Projects
Supply Chain Optimization Projects
 
Entity framework code first
Entity framework code firstEntity framework code first
Entity framework code first
 
Spring Framework - Data Access
Spring Framework - Data AccessSpring Framework - Data Access
Spring Framework - Data Access
 
Find Number of VM message in Mule
Find Number of VM message in MuleFind Number of VM message in Mule
Find Number of VM message in Mule
 
Java Server Faces (JSF) - Basics
Java Server Faces (JSF) - BasicsJava Server Faces (JSF) - Basics
Java Server Faces (JSF) - Basics
 
WebLogic Stability; Detect and Analyse Stuck Threads
WebLogic Stability; Detect and Analyse Stuck ThreadsWebLogic Stability; Detect and Analyse Stuck Threads
WebLogic Stability; Detect and Analyse Stuck Threads
 
WebAssembly Demystified
WebAssembly DemystifiedWebAssembly Demystified
WebAssembly Demystified
 
Java bean
Java beanJava bean
Java bean
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
 
为啥别读HotSpot VM的源码(2012-03-03)
为啥别读HotSpot VM的源码(2012-03-03)为啥别读HotSpot VM的源码(2012-03-03)
为啥别读HotSpot VM的源码(2012-03-03)
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
 
Linq to sql
Linq to sqlLinq to sql
Linq to sql
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Web api using rest based architecture
Web api using rest based architectureWeb api using rest based architecture
Web api using rest based architecture
 
什么是 SECSGEM.pdf
什么是 SECSGEM.pdf什么是 SECSGEM.pdf
什么是 SECSGEM.pdf
 
Oak, the Architecture of the new Repository
Oak, the Architecture of the new RepositoryOak, the Architecture of the new Repository
Oak, the Architecture of the new Repository
 
Responsive Websites
Responsive WebsitesResponsive Websites
Responsive Websites
 

Viewers also liked

PHP-FPMとuWSGI——mod_php以外の選択肢を探る
PHP-FPMとuWSGI——mod_php以外の選択肢を探るPHP-FPMとuWSGI——mod_php以外の選択肢を探る
PHP-FPMとuWSGI——mod_php以外の選択肢を探る
Yoshio Hanawa
 
Webサーバ勉強会4 nginx で php-fpm を動かしてみた
Webサーバ勉強会4 nginx で php-fpm を動かしてみたWebサーバ勉強会4 nginx で php-fpm を動かしてみた
Webサーバ勉強会4 nginx で php-fpm を動かしてみた
do_aki
 
High Performance WordPress
High Performance WordPressHigh Performance WordPress
High Performance WordPress
vnsavage
 

Viewers also liked (20)

PHP Files: An Introduction
PHP Files: An IntroductionPHP Files: An Introduction
PHP Files: An Introduction
 
Techtalk2015 MOD_PHP vs PHP-FPM
Techtalk2015 MOD_PHP vs PHP-FPMTechtalk2015 MOD_PHP vs PHP-FPM
Techtalk2015 MOD_PHP vs PHP-FPM
 
Scaling php - Intercon php
Scaling php - Intercon phpScaling php - Intercon php
Scaling php - Intercon php
 
PHP-FPMとuWSGI——mod_php以外の選択肢を探る
PHP-FPMとuWSGI——mod_php以外の選択肢を探るPHP-FPMとuWSGI——mod_php以外の選択肢を探る
PHP-FPMとuWSGI——mod_php以外の選択肢を探る
 
PHP: SAPI
PHP: SAPIPHP: SAPI
PHP: SAPI
 
PHP conference Berlin 2015: running PHP on Nginx
PHP conference Berlin 2015: running PHP on NginxPHP conference Berlin 2015: running PHP on Nginx
PHP conference Berlin 2015: running PHP on Nginx
 
Building a cloud ready linux image locally using KVM
Building a cloud ready linux image locally using KVM Building a cloud ready linux image locally using KVM
Building a cloud ready linux image locally using KVM
 
Consulによる運用自律化体験ハンズオンとConsul活用事例紹介
Consulによる運用自律化体験ハンズオンとConsul活用事例紹介Consulによる運用自律化体験ハンズオンとConsul活用事例紹介
Consulによる運用自律化体験ハンズオンとConsul活用事例紹介
 
PHP and FastCGI Performance Optimizations
PHP and FastCGI Performance OptimizationsPHP and FastCGI Performance Optimizations
PHP and FastCGI Performance Optimizations
 
A look at FastCgi & Mod_PHP architecture
A look at FastCgi & Mod_PHP architectureA look at FastCgi & Mod_PHP architecture
A look at FastCgi & Mod_PHP architecture
 
Modernisation of Legacy PHP Applications to Symfony2 - Symfony Live Berlin 2012
Modernisation of Legacy PHP Applications to Symfony2 - Symfony Live Berlin 2012Modernisation of Legacy PHP Applications to Symfony2 - Symfony Live Berlin 2012
Modernisation of Legacy PHP Applications to Symfony2 - Symfony Live Berlin 2012
 
Webサーバ勉強会4 nginx で php-fpm を動かしてみた
Webサーバ勉強会4 nginx で php-fpm を動かしてみたWebサーバ勉強会4 nginx で php-fpm を動かしてみた
Webサーバ勉強会4 nginx で php-fpm を動かしてみた
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
サーバー設定のお話
サーバー設定のお話サーバー設定のお話
サーバー設定のお話
 
High Performance WordPress
High Performance WordPressHigh Performance WordPress
High Performance WordPress
 
From LAMP to LNNP
From LAMP to LNNPFrom LAMP to LNNP
From LAMP to LNNP
 
Running php on nginx
Running php on nginxRunning php on nginx
Running php on nginx
 
Word press on conoha このべん #3
Word press on conoha このべん #3Word press on conoha このべん #3
Word press on conoha このべん #3
 
mod_php vs. FastCGI 原理与比较
mod_php vs. FastCGI 原理与比较mod_php vs. FastCGI 原理与比较
mod_php vs. FastCGI 原理与比较
 
PHP7がリリースされたいま、 改めてHackについて考える。
PHP7がリリースされたいま、 改めてHackについて考える。PHP7がリリースされたいま、 改めてHackについて考える。
PHP7がリリースされたいま、 改めてHackについて考える。
 

Similar to mod_php vs FastCGI vs FPM vs CLI

Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
nohuhu
 
Phpworks enterprise-php-1227605806710884-9
Phpworks enterprise-php-1227605806710884-9Phpworks enterprise-php-1227605806710884-9
Phpworks enterprise-php-1227605806710884-9
PrinceGuru MS
 
Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011
Tatsuhiko Miyagawa
 

Similar to mod_php vs FastCGI vs FPM vs CLI (20)

Php through the eyes of a hoster: PHPNW10
Php through the eyes of a hoster: PHPNW10Php through the eyes of a hoster: PHPNW10
Php through the eyes of a hoster: PHPNW10
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
 
Mongodb and Totsy - E-commerce Case Study
Mongodb and Totsy - E-commerce Case StudyMongodb and Totsy - E-commerce Case Study
Mongodb and Totsy - E-commerce Case Study
 
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI serverPyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
Pyruvate, a reasonably fast, non-blocking, multithreaded WSGI server
 
Introduction to PHP (SDPHP)
Introduction to PHP   (SDPHP)Introduction to PHP   (SDPHP)
Introduction to PHP (SDPHP)
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
 
Am\I\Doing\It\Right? Struktura plików w PHP
Am\I\Doing\It\Right? Struktura plików w PHPAm\I\Doing\It\Right? Struktura plików w PHP
Am\I\Doing\It\Right? Struktura plików w PHP
 
How Badoo Saved $1M Switching to PHP7 - Nikolay Krapivnyy - PHPDay Verona 2016
How Badoo Saved $1M Switching to PHP7 - Nikolay Krapivnyy - PHPDay Verona 2016How Badoo Saved $1M Switching to PHP7 - Nikolay Krapivnyy - PHPDay Verona 2016
How Badoo Saved $1M Switching to PHP7 - Nikolay Krapivnyy - PHPDay Verona 2016
 
Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?
Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?
Node.JS Vs PHP: Which Is The Top Server-Side Programming Language?
 
Extensiones In PHP
Extensiones In PHPExtensiones In PHP
Extensiones In PHP
 
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
 
Building APIs with Apigilty and Zend Framework 2
Building APIs with Apigilty and Zend Framework 2Building APIs with Apigilty and Zend Framework 2
Building APIs with Apigilty and Zend Framework 2
 
web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a boss
 
IJS821
IJS821IJS821
IJS821
 
Architeching a php application with interfaces to the ib mi
Architeching a php application with interfaces to the ib miArchiteching a php application with interfaces to the ib mi
Architeching a php application with interfaces to the ib mi
 
What is the best programming language for your web product?
What is the best programming language for your web product?What is the best programming language for your web product?
What is the best programming language for your web product?
 
Optimizing performance
Optimizing performanceOptimizing performance
Optimizing performance
 
Windows Server and Fast CGI Technologies For PHP
Windows Server and Fast CGI Technologies For PHPWindows Server and Fast CGI Technologies For PHP
Windows Server and Fast CGI Technologies For PHP
 
Phpworks enterprise-php-1227605806710884-9
Phpworks enterprise-php-1227605806710884-9Phpworks enterprise-php-1227605806710884-9
Phpworks enterprise-php-1227605806710884-9
 
Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011Deploying Plack Web Applications: OSCON 2011
Deploying Plack Web Applications: OSCON 2011
 

Recently uploaded

一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
aagad
 
Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptx
abhinandnam9997
 

Recently uploaded (12)

History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
 
The AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdfThe AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdf
 
Pvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdf
 
Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptx
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
The Best AI Powered Software - Intellivid AI Studio
The Best AI Powered Software - Intellivid AI StudioThe Best AI Powered Software - Intellivid AI Studio
The Best AI Powered Software - Intellivid AI Studio
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case Study
 

mod_php vs FastCGI vs FPM vs CLI