I have searched everywhere and asked quite a few people and got no where.
I have a script running that gets a certain set of files (info retrieved from mysql database) and then executes a shell command that zips them all into a zip file for easy download.
THE PROBLEM!
Sometimes the collection of files (videos in this case) can be quite large.
Running the shell command to zip such large files can take up to 10mins for 2GB and runs successfully. [i am not looking at collections quite that big for my script]
When I try to call this command during the php, it runs for a little more than 30 seconds, and if it hasn't finished by then, it fails and I am returned an 'Internal Error Page'.
If the command does finish, then the script works perfectly well.
I have tried things like playing around with;
set_time_limit, max_execution_time, max_input_time etc.
I do not have direct access to php.ini (as I am hosting with a company).
Any suggestions would be greatly appreciated!!
<?php
set_time_limit(0);
$files = "";
$count = 0;
$nameofzip = "$race"; $nameofzip .= "$season"; $nameofzip .= ".darcyf1.zip";
$con = mysql_connect("$address","$user","$password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("$table_name", $con);
$sql = "SELECT * FROM clips WHERE (Cat='$series') AND (Season='$season') AND (Race='$race') AND Full IS NULL";
$result = mysql_query($sql);
if($row = mysql_fetch_array($result)){
do {
$files .= "{$row["Link"]} ";
$count = $count + 1;
} while ($row = mysql_fetch_array($result));
}
mysql_free_result($result);
shell_exec("zip $nameofzip $files;");
echo "<br /><strong>$count files zipped - <a href='../go.php?c=$series&f=$nameofzip'>Download</a></strong>";
}
?>
I repeat, the code works perfectly if the command doesn't take too long!
Thanks,
Darcy!