Enable FastCGI on Windows

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

PHP-FPM is not built with the windows binaries. However, it is possible to use PHP-CGI. The executable php-cgi.exe that is bundled in our stacks is a FastCGI interface. Note that it is not FPM (Fastcgi Process Manager) and does not have multi-threading or concurrent request support, nor support for any of the FPM configuration options. Find below the steps to enable it:

  • Assuming your application is running under installdir\apps\application directory, edit installdir\php\php.ini file and set doc_root parameter as below:

      doc_root = "installdir/apps/application/htdocs/"
  • Download winserv from this link.

  • Extract winserv.exe and place it on installdir\scripts directory.

  • Execute this command to create the FastCGI service:

      installdir\scripts\winserv.exe install phpCGI -displayname phpCGI -start auto "installdir\php\php-cgi.exe" -b -c="installdir\php\php.ini"
  • Add the line below in installdir\properties.ini file, inside PHP section:

  • Execute installdir\manager-windows.exe and start PHP server on Manage Servers tab.

  • Edit installdir/apache2\conf\httpd.conf file and enable mod_proxy, mod_proxy_fcgi and authnz_fcgi modules. For that, uncomment these lines:

      #LoadModule proxy_module modules/
      #LoadModule proxy_fcgi_module modules/
      #LoadModule authnz_fcgi_module modules/
  • Add the code below in installdir\apps\application\conf\httpd-app.conf file, inside Directory tag:

      <FilesMatch "\.php$">
        <If "-f %{REQUEST_FILENAME}">
          SetHandler "proxy:fcgi://"
  • Restart Apache server.

Last modification June 10, 2020