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.

xmlapi connecting with cpanel user account instead of root

Discussion in 'cPanel Developers' started by jspicher, Jun 28, 2011.

  1. jspicher

    jspicher Member

    Joined:
    May 19, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    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!
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    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
     
Loading...

Share This Page