Hi all, I have a script that uses curl to "trigger" another script upon a certain event. However, it seems that curl is waiting for the result of the script that it triggered (which is doing a lot of things) before going onto the next step. The problem is The script that is doing the triggering is also supposed to be doing more instead of waiting at each step. Is there any way to speed up this process, or to alter the curl code so it really does function sort of as a ping (IE: it executes an external script, but doesn't wait for any sort of feedback, and goes onto the next thing it's supposed to do?). I've looked into concurrent cURL, but it seems a bit shady, and there is no real strong documentation on how to do it without murdering CPU. I've looked into the PHP CLI via exec() but that also waits for a "response" that hangs the stalls the script This is sorta blowing my mind...any advice would be greatly appreciated .
Instead of using cURL, why don't you trigger the secondary script via an AJAX call or simply by including it as an image. To do the second, have your secondary script output a 1x1px image, and send the content-length header. In your script that is to trigger the secondary script, call it like this: <img src="/my/secondary/script.php" alt="" /> Code (markup):
Interesting idea, Thanks!...would it still require the script being run as the image to fully execute before the next image could be processed? I'm looping through an array, and need to be able to do things in a non-linear method..if that makes sense. For example, I need to process an array of cURL data, and if it matches certain parameters, I trigger a script, but I need it to keep looping through the rest of the array instead of waiting for the triggered script to finish executing before heading to the next variable in the array. Any thoughts?