Let me try to explain to you what i need:
the user creates a post on the site and choose which users can have access to this post. When the user submits the information, each person chosen to have access to post receives an email warning. To perform this I use ajax through jquery. The problem is that this process may be too long until all the emails have been sent.
So I thought the process would work as follows:
1rst - Save the post;
2snd - Save the information of emails (subject, recipient, etc.) in a database table;
3th - run a php file in "parallel" to fetch the information of emails and send them - with the goal of not having to wait for it to execute.
Is the third step possible?
I hope i explain me well :)
Thank you all.
"; exec('bash -c "exec nohup php exect.php > /dev/null 2>&1 &"'); echo "Script end at: " . date('h:i:s');` and in exect.php this ` $handling = fopen(dirname(__FILE__) .'/error_log', 'a+'); fputs($handling, 'Start Execute!!! - server time: ' .$act_date_time_server .' - PT time: ' .$act_date_time ."\r\n"); sleep(1000); fputs($handling, 'End Execute!!! - server time: ' .$act_date_time_server .' - PT time: ' .$act_date_time ."\r\n"); fclose($handling); ` – Pedro Sep 26 '14 at 11:36