title: How do I run cURL request in the background in PHP?
body: <p>I'm trying to build some kind of web based download manager using PHP and the cURL extension, I am stuck with one problem though, how can I download and save the file with cURL without having to make the user wait, meaning he will make the request and it will be processed in the background.</p>
  
  <p>Now I can't use system calls (exec, system ... etc) as most of the hosts I work with disable these functions, and the other problem is the max execution time for PHP scripts, but I guess this one can be changed in .htaccess or using ini_set or can it not?</p>
  
  <p><strong>I've read somewhere that setting connect_timeout to 1 will work, but does not that terminate the connection?</strong> </p>
  
  <p>One solution is to use cronjobs, after the users submits the file he wants to download, a cronjob will check the database and if there is a file in the queue it will start downloading it, but I thought I want to avoid using cron jobs if possible.</p>
  
  <p>So back to the main question, is there a way to tell the php script to run some certain function in the background and delivering the response to the users regardless of the result of that function</p>
  
  <p>Thanks</p>