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;

2 Answers 2

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 &");
Sign up to request clarification or add additional context in comments.

1 Comment

I want add log on 'node.log'
0

I solve it

popen('start /B node-server\socket.server.js > node.log', "r");
return 1;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.