简体   繁体   English

Windows 的 php-fpm?

[英]php-fpm for Windows?

The PHP-FPM's homepage http://php-fpm.org/ states that it is part of PHP since PHP 5.3.3. PHP-FPM 的主页http://php-fpm.org/声明它是 PHP 的一部分,因为 PHP 5.3.3。 Now, I was wondering, when I download the newest PHP binaries from php.net, there is no php-fpm in it.现在,我想知道,当我从 php.net 下载最新的 PHP 二进制文件时,里面没有 php-fpm。 How do I get it?我如何得到它? Is it even available for Windows?它甚至可用于 Windows 吗?

The PHP-FPM's homepage http://php-fpm.org/ states that it is part of PHP since PHP 5.3.3. PHP-FPM 的主页http://php-fpm.org/声明它自 PHP 5.3.3 起成为 PHP 的一部分。 Now, I was wondering, when I download the newest PHP binaries from php.net, there is no php-fpm in it.现在,我想知道,当我从 php.net 下载最新的 PHP 二进制文件时,里面没有 php-fpm。 How do I get it?我如何得到它? Is it even available for Windows?它甚至适用于Windows吗?

The PHP-FPM's homepage http://php-fpm.org/ states that it is part of PHP since PHP 5.3.3. PHP-FPM 的主页http://php-fpm.org/声明它自 PHP 5.3.3 起成为 PHP 的一部分。 Now, I was wondering, when I download the newest PHP binaries from php.net, there is no php-fpm in it.现在,我想知道,当我从 php.net 下载最新的 PHP 二进制文件时,里面没有 php-fpm。 How do I get it?我如何得到它? Is it even available for Windows?它甚至适用于Windows吗?

The PHP-FPM's homepage http://php-fpm.org/ states that it is part of PHP since PHP 5.3.3. PHP-FPM 的主页http://php-fpm.org/声明它自 PHP 5.3.3 起成为 PHP 的一部分。 Now, I was wondering, when I download the newest PHP binaries from php.net, there is no php-fpm in it.现在,我想知道,当我从 php.net 下载最新的 PHP 二进制文件时,里面没有 php-fpm。 How do I get it?我如何得到它? Is it even available for Windows?它甚至适用于Windows吗?

The PHP-FPM's homepage http://php-fpm.org/ states that it is part of PHP since PHP 5.3.3. PHP-FPM 的主页http://php-fpm.org/声明它自 PHP 5.3.3 起成为 PHP 的一部分。 Now, I was wondering, when I download the newest PHP binaries from php.net, there is no php-fpm in it.现在,我想知道,当我从 php.net 下载最新的 PHP 二进制文件时,里面没有 php-fpm。 How do I get it?我如何得到它? Is it even available for Windows?它甚至适用于Windows吗?

The PHP-FPM's homepage http://php-fpm.org/ states that it is part of PHP since PHP 5.3.3. PHP-FPM 的主页http://php-fpm.org/声明它自 PHP 5.3.3 起成为 PHP 的一部分。 Now, I was wondering, when I download the newest PHP binaries from php.net, there is no php-fpm in it.现在,我想知道,当我从 php.net 下载最新的 PHP 二进制文件时,里面没有 php-fpm。 How do I get it?我如何得到它? Is it even available for Windows?它甚至适用于Windows吗?

On Windows, when you run PHP with IIS and install the "PHP FastCGI" module, you get similar functionality to what is explained about PHP-FPM.在 Windows 上,当您使用 IIS 运行 PHP 并安装“PHP FastCGI”模块时,您将获得与关于 PHP-FPM 的解释类似的功能。 In other words, this is not the official PHP-FPM code base, but just similar functionality.换句话说,这不是官方的 PHP-FPM 代码库,而只是类似的功能。

For one, IIS would spawn multiple php-cgi.exe processes (worker processes).一方面,IIS 会产生多个 php-cgi.exe 进程(工作进程)。 And any PHP requests that come in will be handed down to a worker, IIS will dynamically spawn more workers depending on the server resources.并且任何传入的 PHP 请求都将传递给工作人员,IIS 将根据服务器资源动态生成更多工作人员。 These settings are configurable under the "Fast CGI" options for the server tree node on IIS.这些设置可在 IIS 上的服务器树节点的“Fast CGI”选项下进行配置。

That said, I believe performance-wise the php-cgi.exe is not on par with Apache servers.也就是说,我相信 php-cgi.exe 在性能方面与 Apache 服务器不相上下。

You can view the installation procedure for IIS 7 here: https://docs.microsoft.com/en-us/iis/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iis您可以在此处查看 IIS 7 的安装过程: https://docs.microsoft.com/en-us/iis/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to -host-php-applications-on-iis

FastCGI addresses the performance issues that are inherent in CGI by providing a mechanism to reuse a single process over and over again for many requests. FastCGI 解决了 CGI 中固有的性能问题,它提供了一种机制,可以为许多请求一遍又一遍地重用单个进程。 Additionally, FastCGI maintains compatibility with non-thread-safe libraries by providing a pool of reusable processes and ensuring that each process handles only one request at a time.此外,FastCGI 通过提供可重用进程池并确保每个进程一次只处理一个请求来保持与非线程安全库的兼容性。

PHP-FPM uses mainly *NIX specific features and is not likely to ever be ported to Windows. PHP-FPM 主要使用 *NIX 特定功能,并且不太可能移植到 Windows。 In the end there really isn't the motivation, especially when considering php-cgi was developed to allow Windows specific services to configure it as a fork pool.最后真的没有动机,特别是考虑到开发 php-cgi 是为了允许 Windows 特定服务将其配置为分叉池。 Yes, they have their differences, but not enough so to push the community into a complete rewrite of PHP-FPM.是的,它们各有不同,但不足以推动社区完全重写 PHP-FPM。

Keep in mind that php-cgi on Windows is not just multiple instances of a CGI, but uses a Windows managed pool of forked FastCGI processors which use the same architecture of PHP-FPM.请记住,Windows 上的 php-cgi 不仅仅是 CGI 的多个实例,而是使用 Windows 托管的分叉 FastCGI 处理器池,这些处理器使用与 PHP-FPM 相同的架构。 Multiple processes complete the module initialization of PHP, and from these multiple forks are maintained (and restarted when needed) to handle requests.多个进程完成 PHP 的模块初始化,并从中维护(并在需要时重新启动)处理请求。 php-cgi hasn't been a CGI since at least as early as PHP3.至少早在 PHP3 之前,php-cgi 就不是 CGI。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM