I am quite new to node.js programming. I am using linux dedicated server. I already have installed node.js in my server(linux).
I am using follwing php program to run the linux command so i can run node.js program by these linux command
test.php:
exec('node test.js &', $a1,$a2);
print_r($a1);
echo $a2;
And after running this program it showing following o/p:
Array ( ) 0
But not returns any value in $a1 variable where it should display "Hello World"
test.js:
var http = require("http");
http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
}).listen(8888);
I also tried with port 3000 and 8000.
var_dump(function_exists('pcntl_fork'));?