curl – Avoid ‘waiting for response’ in php? – Education Career Blog

I have a php script that uses exec() function to execute curl to download file. The file is about 600mb. So when I acess the php file on a browser, browsers shows me ‘waiting for response’ message.

How do I avoid that?

my php source is

$a = exec(“curl ‘’ -o ‘test.avi'”);


For a Linux host, you should only need to add & to the end of your exec() call:

$a = exec("curl '' -o 'test.avi' &");

It’s a little more complex for Windows:

$WshShell = new COM("WScript.Shell");
$a = $WshShell->Run("curl '' -o 'test.avi'", 0, false);

Leave a Comment