Home PHP exec(), fire and forget, load page content, but ajax request don't start until that process end
Reply: 1

PHP exec(), fire and forget, load page content, but ajax request don't start until that process end

Luca Olivieri
1#
Luca Olivieri Published in 2018-01-12 16:44:58Z

This question already has an answer here:

  • Asynchronous shell exec in PHP 13 answers

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?

DestructionOfPlanetNeptune
2#
DestructionOfPlanetNeptune Reply to 2018-01-12 17:25:43Z

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?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.35927 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO