In a PHP (server) program I have:
file_put_contents("large_file.txt",$logs."\n",FILE_APPEND|LOCK_EX);
and just after this line an echo:
echo json_encode($params);
The first line takes a lot of time to execute, maybe because $logs can contain a very large amount of data.
Is there any way to let file_puts_contents work independently and jump to the next line?