leafee98-blog/content/essays/php-cgi-vs-php-fpm.md

20 lines
840 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "PHP-CGI 与 PHP-FPM 的关系"
date: 2021-01-14T21:50:05+08:00
tags: []
categories: []
weight: 50
show_comments: true
draft: false
---
CGI 约束了 HTTP 服务端分发程序与后面的服务处理程序之间消息传输的格式,是一个规范或协议。
PHP-CGI 是 HTTP 分发以后真正处理数据的程序,而 PHP-FPMFastCGI Process Manager去管理和调度多个 PHP-CGI 来提高性能。
如果站点流量较大,那么使用 PHP-FPM 能够更加充分利用资源如果流量较小PHP-CGI 会更好地运行 PHP 代码(参考 2并且足以处理较小的流量。
## 参考:
1. [https://segmentfault.com/q/1010000000256516](https://segmentfault.com/q/1010000000256516)
2. [https://www.basezap.com/difference-php-cgi-php-fpm/](https://www.basezap.com/difference-php-cgi-php-fpm/)