Child failed to make LIVEAPI connection to cPanel

ayman qaidi

Member
May 13, 2016
6
0
1
earth
cPanel Access Level
Root Administrator
hello

i am trying to develop an plugin for cpanel when i use UAPI Functions - SSL::list_certs i am getting this error " Child failed to make LIVEAPI connection to cPanel " can not debug or know what caused this

my code is php and this is my code


PHP:
  // List an account's certificates.
    $SSL_list_certs = $livecpapi->uapi(
        'SSL', 'list_certs',
    );
   var_dump($SSL_list_certs);

please help
 

ayman qaidi

Member
May 13, 2016
6
0
1
earth
cPanel Access Level
Root Administrator
here is error_log

Code:
Child failed to make LIVEAPI connection to cPanel from: ./3rdparty/qaidissl/index.live.php. at cpanel.pl line 4926.
[2016-05-13 15:44:24 +0200] warn [cpsrvd] The subprocess ( (cpanel)) exited with an error: The subprocess reported error number 10 when it ended. at /usr/local/cpanel/Cpanel/Server/Handlers/SubProcess.pm line 155.
    Cpanel::Server::Handlers::SubProcess::_report_subprocess_errors(Cpanel::Server::Handlers::SubProcess=HASH(0x2545870)) called at /usr/local/cpanel/Cpanel/Server/Handlers/SubProcess.pm line 72
    Cpanel::Server::Handlers::SubProcess::handler(Cpanel::Server::Handlers::SubProcess=HASH(0x2545870), "subprocess_name", " (cpanel)", "subprocess_read_handle", IO::Handle=GLOB(0x2546110), "subprocess_write_handle", IO::Handle=GLOB(0x2548598), "api_type", "html", ...) called at cpsrvd.pl line 6478
    cpanel::cpsrvd::cpHandler("document", "./3rdparty/qaidissl/index.live.php") called at cpsrvd.pl line 2503
    cpanel::cpsrvd::dodoc_cpaneld() called at cpsrvd.pl line 1672
    cpanel::cpsrvd::dodoc(HASH(0xedc268)) called at cpsrvd.pl line 1347
    cpanel::cpsrvd::handle_one_connection() called at cpsrvd.pl line 841
    cpanel::cpsrvd::script() called at cpsrvd.pl line 334
any help here ?
 
Last edited by a moderator:

ayman qaidi

Member
May 13, 2016
6
0
1
earth
cPanel Access Level
Root Administrator
issue was with php syntax that in cpanel doc

changed to
Code:
  // List an account's certificates.
    $SSL_list_certs = $livecpapi->uapi(
        'SSL', 'list_certs'
    );
   var_dump($SSL_list_certs);
working fine
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

I'm happy to see you were able to address the issue. The "Child failed to make LIVEAPI connection to cPanel" error message typically indicates some type of syntax error with the script. In this case, it looks like the document in question shows a comma after the "'SSL', 'list_certs'" entry when it's not required.

Here's a full working example script for anyone else browsing this thread with the same question:

Code:
<?php
include("/usr/local/cpanel/php/cpanel.php");  // Instantiate the CPANEL object.
$cpanel = new CPANEL();                       // Connect to cPanel - only do this once.
print $cpanel->header( "Page Heading" );      // Add the header.
?>
<?php
// List an account's certificates.
$SSL_list_certs = $cpanel->uapi(
    'SSL', 'list_certs'
);
var_dump($SSL_list_certs);
?>
<?php
print $cpanel->footer();                      // Add the footer.
$cpanel->end();                               // Disconnect from cPanel - only do this once.
?>
I've opened a case with our documentation team to correct the error on the following document:

https://documentation.cpanel.net/display/SDK/UAPI+Functions+-+SSL::list_certs

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Our documentation team has now updated the document referenced in the previous response, in addition to other LiveAPI PHP examples throughout our documentation, to correct the trailing comma syntax.

Thank you.