I have controller like this
public function test()
{
shell_exec("node node-server\socket.server.js > node.log");
return 1;
}
but when I run this controller with ajax, status is (pending) and I want show me 1;
I have controller like this
public function test()
{
shell_exec("node node-server\socket.server.js > node.log");
return 1;
}
but when I run this controller with ajax, status is (pending) and I want show me 1;
ajax is waiting the ending of node js query, you have to send it to process in background by adding
shell_exec("node node-server\socket.server.js > /dev/null &");
I solve it
popen('start /B node-server\socket.server.js > node.log', "r");
return 1;