I decided to run the parser in several processes. To do this, first run the program in the console like this: "php parse.php m 4". After that, the program considers how many goods it is necessary to parse and starts 4 daemon with parameters offset and limit:
exec($path_php.' -q parse.php p '.$offset.' '.$limit.' '.$i.' > logs\daemon_'.$i.'.log 2>&1 &'); According to the documentation, it is necessary for exec not to hang, so that it does not display anything on the screen, so I saved it to the log, as you can see. In my program I use the print operator. How to make exec not hang? That started the demons and let them work in the background itself.
... > log 2>&1 &and your php is still waiting for completion? Or what? Andprintin the daemon or in the program that launches the daemon? - BOPOH