0

on my site i try to fire and forget with php:

this line starts a process about 20 seconds:

exec('wget -qO- url-to-process' > /dev/null &');

All script is loaded , without attending this line. Now my page is fully loaded. But I have a DataTable, populated with an ajax request. The question is why ajax request doesn't start until that 20 seconds? What could be the problem?

Luca Olivieri
  • 303
  • 1
  • 8
  • Sessions in the mix? Then it might be the session file being locked - try session_write_close before exec. – CBroe Jan 12 '18 at 16:47
  • Possible duplicate of [Asynchronous shell exec in PHP](https://stackoverflow.com/q/222414/1255289) – miken32 Jan 12 '18 at 18:38

1 Answers1

0

Do you have a chance to use network tools in the browser and see what runs at what point? Why don't you add logging the microtime of each of the calls and see what comes out of it?