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?
mod_php vs FastCGI vs FPM vs CLI
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
mod_php vs FastCGI vs FPM vs CLI
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
mod_php vs FastCGI vs FPM vs CLI
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
mod_php vs FastCGI vs FPM vs CLI
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

PDF
A look at FastCgi & Mod_PHP architecture
PPTX
XXE: How to become a Jedi
PDF
MySQL Parallel Replication by Booking.com
PPTX
Setting up a web server in Linux (Ubuntu)
PDF
Linux Networking Explained
PDF
Java Performance Analysis on Linux with Flame Graphs
PDF
Teach a Dog to REST
PDF
Velocity 2017 Performance analysis superpowers with Linux eBPF
A look at FastCgi & Mod_PHP architecture
XXE: How to become a Jedi
MySQL Parallel Replication by Booking.com
Setting up a web server in Linux (Ubuntu)
Linux Networking Explained
Java Performance Analysis on Linux with Flame Graphs
Teach a Dog to REST
Velocity 2017 Performance analysis superpowers with Linux eBPF

What's hot (20)

PDF
MySQL Monitoring with Zabbix
PDF
Weaponizing Recon - Smashing Applications for Security Vulnerabilities & Profits
PDF
Shell scripting
PDF
Under the Hood: Open vSwitch & OpenFlow in XCP & XenServer
PPTX
Abusing Microsoft Kerberos - Sorry you guys don't get it
PDF
Gdb basics for my sql db as (percona live europe 2019)
PDF
Kernel Recipes 2017: Using Linux perf at Netflix
PDF
BloodHound Unleashed.pdf
PDF
An introduction to MongoDB
PDF
ORM2Pwn: Exploiting injections in Hibernate ORM
PDF
High Availability PostgreSQL with Zalando Patroni
PDF
Linux Binary Exploitation - Return-oritend Programing
PPTX
Directory Traversal & File Inclusion Attacks
PDF
A Journey into Hexagon: Dissecting Qualcomm Basebands
PDF
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
PDF
스타트업 인턴 개발자 3달간의 고군분투기 김은향
PDF
Tools for Solving Performance Issues
PPTX
Linux and Java - Understanding and Troubleshooting
PPTX
php and sapi and zendengine2 and...
PPTX
Dangling DNS records takeover at scale
MySQL Monitoring with Zabbix
Weaponizing Recon - Smashing Applications for Security Vulnerabilities & Profits
Shell scripting
Under the Hood: Open vSwitch & OpenFlow in XCP & XenServer
Abusing Microsoft Kerberos - Sorry you guys don't get it
Gdb basics for my sql db as (percona live europe 2019)
Kernel Recipes 2017: Using Linux perf at Netflix
BloodHound Unleashed.pdf
An introduction to MongoDB
ORM2Pwn: Exploiting injections in Hibernate ORM
High Availability PostgreSQL with Zalando Patroni
Linux Binary Exploitation - Return-oritend Programing
Directory Traversal & File Inclusion Attacks
A Journey into Hexagon: Dissecting Qualcomm Basebands
MySQL Indexing : Improving Query Performance Using Index (Covering Index)
스타트업 인턴 개발자 3달간의 고군분투기 김은향
Tools for Solving Performance Issues
Linux and Java - Understanding and Troubleshooting
php and sapi and zendengine2 and...
Dangling DNS records takeover at scale
Ad

Viewers also liked (20)

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

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

KEY
Php through the eyes of a hoster: PHPNW10
PPTX
Information on PHP Handlers
KEY
SydPHP March 2012 Meetup
PDF
Php through the eyes of a hoster confoo
PDF
PPTX
Php internal architecture
PDF
Php through the eyes of a hoster phpbnl11
PDF
PHP, Handle with care
PDF
Php through the eyes of a hoster
PPTX
Apache web server
PPT
PHP Custom Web application development
PDF
Php Interview Questions
PDF
Introducción a Nginx y PHP FPM
PDF
Manual oficial de php5
ODP
Choosing a Web Architecture for Perl
PDF
PDF
Apache2 BootCamp : Serving Dynamic Content with CGI
PPT
Download It
PPTX
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
PPTX
Hacking hhvm
Php through the eyes of a hoster: PHPNW10
Information on PHP Handlers
SydPHP March 2012 Meetup
Php through the eyes of a hoster confoo
Php internal architecture
Php through the eyes of a hoster phpbnl11
PHP, Handle with care
Php through the eyes of a hoster
Apache web server
PHP Custom Web application development
Php Interview Questions
Introducción a Nginx y PHP FPM
Manual oficial de php5
Choosing a Web Architecture for Perl
Apache2 BootCamp : Serving Dynamic Content with CGI
Download It
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Hacking hhvm

Recently uploaded (20)

PDF
Cloud-Scale Log Monitoring _ Datadog.pdf
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PDF
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
PDF
Sims 4 Historia para lo sims 4 para jugar
PPTX
Power Point - Lesson 3_2.pptx grad school presentation
PPTX
artificialintelligenceai1-copy-210604123353.pptx
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PPTX
international classification of diseases ICD-10 review PPT.pptx
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PDF
Paper PDF World Game (s) Great Redesign.pdf
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
DOCX
Unit-3 cyber security network security of internet system
PPTX
Module 1 - Cyber Law and Ethics 101.pptx
PDF
Exploring VPS Hosting Trends for SMBs in 2025
PDF
Introduction to the IoT system, how the IoT system works
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PDF
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)
Cloud-Scale Log Monitoring _ Datadog.pdf
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
Job_Card_System_Styled_lorem_ipsum_.pptx
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
Sims 4 Historia para lo sims 4 para jugar
Power Point - Lesson 3_2.pptx grad school presentation
artificialintelligenceai1-copy-210604123353.pptx
An introduction to the IFRS (ISSB) Stndards.pdf
Design_with_Watersergyerge45hrbgre4top (1).ppt
international classification of diseases ICD-10 review PPT.pptx
522797556-Unit-2-Temperature-measurement-1-1.pptx
Paper PDF World Game (s) Great Redesign.pdf
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PptxGenJS_Demo_Chart_20250317130215833.pptx
Unit-3 cyber security network security of internet system
Module 1 - Cyber Law and Ethics 101.pptx
Exploring VPS Hosting Trends for SMBs in 2025
Introduction to the IoT system, how the IoT system works
Tenda Login Guide: Access Your Router in 5 Easy Steps
FINAL CALL-6th International Conference on Networks & IOT (NeTIOT 2025)

mod_php vs FastCGI vs FPM vs CLI