20 lines
840 B
Markdown
20 lines
840 B
Markdown
|
---
|
|||
|
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-FPM(FastCGI 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/)
|