Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
When load balancers have set timeouts at 30 seconds, this script will process requests that may take longer than 30 seconds (up to 15 minutes) without causing a timeout.
$cmd = "zip -9prv .";
$pipe = popen($cmd, 'r');
if (empty($pipe)) {
throw new Exception("Unable to open pipe for command '$cmd'");
stream_set_blocking($pipe, false);
echo "\n";
while (!feof($pipe)) {
fread($pipe, 1024);
echo ".";
echo "\n";
echo "Complete";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment