php-fpm for Windows?

后端 未结 5 1411
灰色年华
灰色年华 2020-12-02 09:02

The PHP-FPM\'s homepage http://php-fpm.org/ states that it is part of PHP since PHP 5.3.3. Now, I was wondering, when I download the newest PHP binaries from php.net, there

5条回答
  •  隐瞒了意图╮
    2020-12-02 09:18

    Alan's answer is a great start. However, for Apache 2.4 and later you do not need to run PHP-FPM as a separate service, you can use mod_fcgid to handle everything within Apache.

    Here is an example configuration:

    LoadModule fcgid_module modules/mod_fcgid.so
    
    FcgidInitialEnv PHPRC "c:/php"
    FcgidInitialEnv PATH "c:/php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
    FcgidInitialEnv SystemRoot "C:/Windows"
    FcgidInitialEnv SystemDrive "C:"
    FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
    FcgidInitialEnv TMP "C:/WINDOWS/Temp"
    FcgidInitialEnv windir "C:/WINDOWS"
    FcgidIOTimeout 64
    FcgidConnectTimeout 16
    FcgidMaxRequestsPerProcess 500
    
    
      AddHandler fcgid-script .php
      FcgidWrapper c:/php/php-cgi.exe .php
     
    

    Note, this is based on a post in Apache Lounge. As helpful as it was, their version had quotes around c:/php/php-cgi.exe and if you do that it WILL NOT START php-cgi.exe, at least on Windows Server 2012, and you get HTTP 500. Took me a painful few days to figure that out.

提交回复
热议问题