how to run a php when the current script finishes using curl ?
cant use shell or set_time_limit to loop the script .
EDIT:
I want to be able to use curl to call the same script , but when i use curl_exec , i don’t want the script to wait till curl finishes , i just want it to call the page and keep moving on without waiting curl to finish .
EDIT:
using this code on the start of the script
ignore_user_abort(true);
header("Content-Length: 0");
header("Connection: close");
flush();
then using curl to make the script call it self works on windows , but on linux it doesn’t ! aka , i want curl to call a page and not wait for a response
Thanks
Found it :
adding this to the start of the script :
then call this 1_script from another 2_script via curl allows the other 2_script to complete its process without waiting for 1_script to finish ! . it’s just that curl won’t read the “connection:close” header before 256 byes are recieved , so we send them via spaces 🙂