I am trying to get php working on my express js website using the php-express module. Unfortunatly, from what I’ve gathered and tried from what I could find online, I get the following error:
Error: Command failed: php mysitedirnode_modulesphp-expresslibPHPExpress/../../page_runner.php mysitedirStorage mysitedirStorageget_video_info.php
‘php’ is not recognized as an internal or external command,
operable program or batch file.
Here are some snippets from my express.js file:
var phpExpress = require('php-express')({
binPath: 'php'
});
app.engine('php', phpExpress.engine);
app.all(/.+.php$/, phpExpress.router);
And then in my route for /get_video_info.php:
app.route("/")
.all(async (req, res) => {
console.log("weee");
return await res.render(path.resolve('Storage','get_video_info.php'));
});