What is the difference between a PHP interpreter and a PHP handler?

Technology CommunityCategory: PHPWhat is the difference between a PHP interpreter and a PHP handler?
VietMX Staff asked 4 years ago

PHP Handler is an Apache module that is used by Apache to communicate with the Php Interpreter. It is basically used by Apache to handle requests for Php files. There are different types of Php Handlers. For example mod_php is an Apache module for Php. mod_fcgid allows communication with the php_fpm interpreter over a TCP or Unix socket.

The PHP Interpreter is an application that executes Php code one line at a time. The output of the Php Interpreter is sent to the Php Handler. This output may be processed by other Apache modules such as mod_deflate or mod_security. The final output is sent out of the TCP socket that Apache listens on.