The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Child failed to make LIVEAPI connection to cPanel

Discussion in 'cPanel Developers' started by ayman qaidi, May 13, 2016.

Tags:
  1. ayman qaidi

    ayman qaidi Registered

    Joined:
    May 13, 2016
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  2. ayman qaidi

    ayman qaidi Registered

    Joined:
    May 13, 2016
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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 ?
     
    #2 ayman qaidi, May 13, 2016
    Last edited by a moderator: May 13, 2016
  3. ayman qaidi

    ayman qaidi Registered

    Joined:
    May 13, 2016
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    651
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    651
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page