node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



connect middleware to pass requests to FastCGI server process.


Because PHP-FPM. Yes, that's right, it's insanity, but I need it, mainly for development and automated testing tasks I do with grunt and simple node.js scripts.

This module is a stripped down version of this server converted to connect middleware. It was then modified to support POST and PUT, pass required headers etc.


var connect = require('connect'), 
    php = require('../connect-fastcgi');
var app = connect()
        .use('/php', php({ fastcgiPort: 8002, fastcgiHost: 'localhost', root: "./php" }))

Available options:

  • root: root directory for scripts
  • fastcgiHost: host or socket path to FastCGI process
  • fastcgiPort: port


David Coallier for original node-php module