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.

Backup Scrtipt API Error: Can't call method "login" on an undefined value

Discussion in 'cPanel Developers' started by gigamike, Jun 30, 2015.

  1. gigamike

    gigamike Member

    Joined:
    Jan 14, 2008
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    Guys,

    I hope you can help me, i do have a cron that creates a backup of my cpanel using the API
    Fileman i.e.

    require_once $basePath . "/public_html/library/xmlapi-php-master/xmlapi.php";
    $xmlapi = new \xmlapi($source_server_ip);
    $xmlapi->password_auth($cpanel_account,$cpanel_password);
    $xmlapi->set_port($cpanel_port);
    $xmlapi->set_debug(1);
    $api_args = array(
    'passiveftp',
    $ftphost,
    $ftpacct,
    $ftppass,
    $email_notify,
    $ftpport,
    $ftpdirectory
    );
    $xmlapi->set_output('json');
    print $xmlapi->api1_query($cpanel_account, 'Fileman', 'fullbackup', $api_args);

    It works fine before but with the sudden update on WHM i notice i started receiving this error.

    Can't call method "login" on an undefined value

    Any ideas?

    I tried the accounts i set but i can login successfully (cpanel accoung and ftp account)

    Thanks in advance,

    Mike
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page