xmlapi connecting with cpanel user account instead of root

jspicher

Member
May 19, 2011
5
0
51
Hey guys,
We're trying to connect to the xmlapi with the cpanel user, instead of our root account, but it doesn't seem to be working. We get "access denied". Here's the code being used:

PHP:
<?

require("xmlapi.php");

$x = new xmlapi("mysite.com");
$x->password_auth("myuser", "mypass");
$x->set_debug(1);
$x->listips();

?>
Any help would be greatly appreciated!
 

cPanelDavidN

Well-Known Member
Staff member
Dec 17, 2009
571
3
68
Houston, TX
cPanel Access Level
Root Administrator
When connecting as a cpanel user, you need to use port 2083 (or the non-ssl port 2083)
PHP:
$x->set_port(2083);
The xmlapi class uses port 2087 as the default, which is the WHM port. Only root or a reseller can use port 2087 (or the non-ssl port 2086).

Regards,
-DavidN