I'm using the following code to add a sub domain:
And the error I get is: Can't use an undefined value as a subroutine reference at cpanel.pl line 1825
As another test, and using the same authorisation code, the function addpop to add a new mailbox works fine.
Cpanel version 62.0(build 7), Php 5.6.30, Perl 5.10.1, theme 'paper_lantern'.
Any ideas please?
Code:
include 'xmlapi.php';
$cpanel_host = 'mydomain.uk';
$cpanel_user = 'someuser';
$subdomain = 'mysubdomain';
$cpanel_pass = 'mypass';
$dir = 'public_html/'.$subdomain;
$xmlapi = new xmlapi($cpanel_host);
$xmlapi->password_auth($cpanel_user, $cpanel_pass);
$xmlapi->set_http_client('curl');
$xmlapi->set_port(2083);
$xmlapi->set_output('json');
$xmlapi->set_debug(1);
$opts = array($subdomain,$cpanel_host,$dir,'1');
print $xmlapi->api1_query($cpanel_user, "Subdomain", "addsubdomain", $opts);
As another test, and using the same authorisation code, the function addpop to add a new mailbox works fine.
Cpanel version 62.0(build 7), Php 5.6.30, Perl 5.10.1, theme 'paper_lantern'.
Any ideas please?
Last edited: