mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -07:00
avoid out-of-memory serving large logfiles
large logfiles previously resulted in out-of-memory errors, see https://github.com/hestiacp/hestiacp/issues/2736 hestacp PR: https://github.com/hestiacp/hestiacp/pull/2741 and no, removing the php end tag was not an accident, it was intentional. end tags, ideally, should only be used when they're absolutely required, because they can easily introduce bugs like printing a newline after the end tag.
This commit is contained in:
parent
a2da58841b
commit
b13b82112a
1 changed files with 13 additions and 6 deletions
|
@ -25,11 +25,18 @@ $v_domain = escapeshellarg($_GET['domain']);
|
|||
if ($_GET['type'] == 'access') $type = 'access';
|
||||
if ($_GET['type'] == 'error') $type = 'error';
|
||||
|
||||
exec (VESTA_CMD."v-list-web-domain-".$type."log $user ".$v_domain." 5000", $output, $return_var);
|
||||
if ($return_var == 0 ) {
|
||||
foreach($output as $file) {
|
||||
echo $file . "\n";
|
||||
}
|
||||
|
||||
|
||||
$cmd = implode(" ", array(
|
||||
escapeshellarg(HESTIA_CMD . "v-list-web-domain-" . $type . "log"),
|
||||
escapeshellarg($user),
|
||||
escapeshellarg($v_domain),
|
||||
"5000",
|
||||
));
|
||||
passthru($cmd, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$errstr = "Internal server error: command returned non-zero: {$return_var}: {$cmd}";
|
||||
echo $errstr;
|
||||
throw new Exception($errstr); // make sure it ends up in an errorlog somewhere
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue