I have a deal where file1.php curl runs file2.php. file2.php is a long running file, but it sends(or is supposed to send) a response back to file1.php then carry on with it\
In a normal curl transfer you wouldn't be able to get the data until the page has completed loading ie. your script is finished. If you want to work with partial data, you should look at CURLOPT_WRITEFUNCTION . This creates a callback which you can use whenever any data is available.