Run PHP scripts in node
JavaScript PHP
Latest commit 78f812b Apr 27, 2016 @mkschreder Merge pull request #14 from philippsimon/master
Fix for OS X, mocha tests & eslint added, general cleanup

NodePHP - run wordpress (and other php scripts) with node

With Node PHP you can leverage the speed of node js and run all of the widely available php scripts directly inside your express site.


npm install node-php


To run wordpress with node js and express do this:

var express = require('express');
var php = require("node-php"); 
var path = require("path"); 

var app = express();

app.use("/", php.cgi("/path/to/wordpress")); 


console.log("Server listening!");


The script will pipe all files that end in the .php extension through the php parser. All other files will be served as static content.

Basic permalinks are supported but the support for them can probably be improved.


  • php-cgi - you need to have the interpreter installed in order to use this extension


Copyright © 2014-2016 Martin K. Schröder

The MIT License (MIT) - See LICENSE for further details.