Fix LIVEAPI error: initialize Cpanel::LiveAPI in .live.cgi files
cPanel's live engine requires .live.cgi files to create a Cpanel::LiveAPI connection. Without it, the engine cannot establish communication with the CGI subprocess. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,9 +14,11 @@ BEGIN {
|
||||
unshift @INC, "$base/lib";
|
||||
}
|
||||
|
||||
use Cpanel::LiveAPI ();
|
||||
use Cpanel::AdminBin::Call ();
|
||||
use GnizaCPanel::UI;
|
||||
|
||||
my $cpanel = Cpanel::LiveAPI->new();
|
||||
print "Content-Type: text/html\r\n\r\n";
|
||||
|
||||
# Get allowed remotes via AdminBin
|
||||
@@ -28,6 +30,7 @@ print GnizaCPanel::UI::page_header('gniza Restore');
|
||||
if (!@remotes) {
|
||||
print qq{<div class="alert alert-info mb-4">No backup remotes are available for restore. Please contact your server administrator.</div>\n};
|
||||
print GnizaCPanel::UI::page_footer();
|
||||
$cpanel->end();
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -103,3 +106,4 @@ for my $cat (@categories) {
|
||||
print qq{</div>\n};
|
||||
|
||||
print GnizaCPanel::UI::page_footer();
|
||||
$cpanel->end();
|
||||
|
||||
@@ -14,10 +14,13 @@ BEGIN {
|
||||
unshift @INC, "$base/lib";
|
||||
}
|
||||
|
||||
use Cpanel::LiveAPI ();
|
||||
use Cpanel::AdminBin::Call ();
|
||||
use Cpanel::Form ();
|
||||
use GnizaCPanel::UI;
|
||||
|
||||
my $cpanel = Cpanel::LiveAPI->new();
|
||||
END { $cpanel->end() if $cpanel }
|
||||
my $form = Cpanel::Form::parseform();
|
||||
my $method = $ENV{'REQUEST_METHOD'} // 'GET';
|
||||
my $step = $form->{'step'} // '1';
|
||||
|
||||
Reference in New Issue
Block a user