### php.java.servlet

# Class FastCGIServlet

- `java.lang.Object`

- `javax.servlet.GenericServlet`

- `javax.servlet.http.HttpServlet`

- `php.java.servlet.CGIServlet`

- `php.java.servlet.FastCGIServlet`

Implemented Interfaces:
  java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

Known Direct Subclasses:
  PhpJavaServlet

`public class FastCGIServlet`
`extends CGIServlet`

A CGI Servlet which connects to a FastCGI server. If there's nothing listening on port FCGI_CHANNEL and fast cgi binary installed in Util.DEFAULT_CGI_LOCATIONS, the php binary will be started. It will be stopped when the VM shuts down.
NOTE: If the user has copied a cgi binary into his WEB-INF/cgi directory, FastCGI is not available anymore; FastCGI requires that the cgi binary is installed as a well known system file in one of the DEFAULT_CGI_LOCATIONS.

Author:
  jostb

See Also:
  `Util.DEFAULT_CGI_LOCATIONS`, Serialized Form

## Field Summary

`static int`

`FCGI_CHANNEL`
  The Fast CGI default port

## Method Summary

`void`

`destroy()`

`boolean`

`fcgiIsAvailable()`
  If the user has copied a cgi binary into his WEB-INF/cgi directory, FastCGI is not available anymore; FastCGI requires that the cgi binary is installed as a well known system file in one of the DEFAULT_CGI_LOCATIONS.

`void`

`init(javax.servlet.ServletConfig config)`

### Methods inherited from class php.java.servlet.CGIServlet

`init`

### Methods inherited from class javax.servlet.http.HttpServlet

`service`

### Methods inherited from class javax.servlet.GenericServlet

`destroy`, `getInitParameter`, `getInitParameterNames`, `getServletConfig`, `getServletContext`, `getServletInfo`, `getServletName`, `init`, `init`, `log`, `log`, `service`

### Methods inherited from class java.lang.Object

`equals`, `getClass`, `hashCode`, `notify`, `notifyAll`, `toString`, `wait`, `wait`, `wait`

## Field Details

### FCGI_CHANNEL

    public static final int FCGI_CHANNEL

> The Fast CGI default port

> Field Value:
>   9667

## Method Details

### destroy

    public void destroy()

> Specified by:
>   destroy in interface javax.servlet.Servlet
> Overrides:
>   destroy in interface javax.servlet.GenericServlet

### fcgiIsAvailable

    public boolean fcgiIsAvailable()

> If the user has copied a cgi binary into his WEB-INF/cgi directory, FastCGI is not available anymore; FastCGI requires that the cgi binary is installed as a well known system file in one of the DEFAULT_CGI_LOCATIONS.

> Returns:
>   false if the user has set the parameter `php_exec` or has copied his own CGI binary into his WEB-INF/cgi directory, true otherwise.

> See Also:
>   `Util.DEFAULT_CGI_LOCATIONS`

### init

    public void init(javax.servlet.ServletConfig config)
                throws javax.servlet.ServletException

> Specified by:
>   init in interface javax.servlet.Servlet
> Overrides:
>   init in interface CGIServlet