0

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;

paranoid
  • 6,799
  • 19
  • 49
  • 86

2 Answers2

2

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 &");
Awais Rafique
  • 466
  • 6
  • 17
0

I solve it

popen('start /B node-server\socket.server.js > node.log', "r");
return 1;
paranoid
  • 6,799
  • 19
  • 49
  • 86