UNPKG

phpcgijs

Version:

Run and Execute PHP, JS, Ruby, Python 2, Python 3, ASPX, JSP, and CGI in CGI / Shell mode using node.js npm package / module. Includes cgijs npm module. `CGIJS` is a Nodejs Module/library to run any `CGI` mode/`Interpreted language script` files like PHP,

16 lines (12 loc) 456 B
var express = require('express'); var php = require("./main"); // var php = require("phpcgijs"); var path = require("path"); var app = express(); var p = path.join("test/php"); app.use("/", php.cgi(p, { cgi_path: '/usr/bin/', options: { "-c": "/etc/php.ini" } })) app.use("*", function(req, res) { return res.send("Thank you for using node-cgi-php. Please map your urls") }) app.listen(9090, '127.0.0.1'); console.log("Server listening at 9090!");