I'm trying to execute nodejs with php, do this it's really simple
<? shell_exec("node app.js &"); ?>
My nodejs file creates a server with express.
var express = require("express"),
app = express();
app.get('/', function(request,response)
{
response.status(200).send("Welcome");
});
app.listen(82, 'localhost', function(){console.log("Server are running on port 82");});
When the file runs this is the output
Error: listen EACCES 127.0.0.1:82
at Object.exports._errnoException (util.js:873:11)
at exports._exceptionWithHostPort (util.js:896:20)
at Server._listen2 (net.js:1237:19)
at listen (net.js:1286:10)
at net.js:1395:9
at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:64:16)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:83:10)
The port is open, this is the output for "service iptables status" command
20 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpts:81:90
I think the error is because apache (apache runs on port 80) don't have permission to create a server
Someone have any idea of how solve this?