I’ve managed to get it working before. I use a NPM module called php-express
How to implement:
var phpExpress = require('php-express')({
// Set bin path of PHP
binPath: 'php'
});
// We're assuming your express app variable is called 'app'
// Apply PHP manager
app.engine('php', phpExpress.engine);
app.set('view engine', 'php');
app.all(/.+\.php$/, phpExpress.router);