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 keepingWhat is a process?
A process isAn app answering a request
Request
App
Response
A thread isAn task requested by a process
Request
Process
Response
Thread Thread Thread
Ready to keep diving?That was the easy part.
How does our server talk to PHP?
SAPI: Server Application Interface
http://www.slideshare.net/auroraeosrose/php-extensions-45834933
Even extensions
What are the types?The rabbit hole keeps going.
Starting with CGIApplies both to CGI and FPM
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!
nginx vs apacheThis rabbit needs some white gloves
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.
CLI is command line SAPIyou know $ php…
$ php -a access interactive shell
mod_php vs PHP CLI vs FastCGI vs FPM@jacques_thekit
Resourceshttps://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