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

gigamike

Active Member
Jan 14, 2008
25
0
51
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,213
363
Hello :)

Does the issue persist if you temporarily disable any active firewall rules on your system?

Thank you.