Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

cPanel UAPI returns null

Discussion in 'cPanel Developers' started by KuroiNekoDev, Aug 8, 2018.

Tags:
  1. KuroiNekoDev

    KuroiNekoDev Registered

    Joined:
    Mar 3, 2018
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Nowhere
    cPanel Access Level:
    Reseller Owner
    Hi, I created a little script for manage email accounts from my reseller hosting...

    This script use the cPanel UAPI Library created by N1ghteyes (github.com/N1ghteyes/cpanel-UAPI-php-class) and works very well...

    Recently a friend tried to use it in his VPS (from Mochahost), but It doesn't work...

    So we created a simple file for try the connection (below is the code)

    PHP:
    <?php
            
    require 'class/cpaneluapi.php';
            require 
    'whm_config.php'// Here I define the constants from the server as User, Pass & IP


            
    $WHM = new cpanelAPI(WHM_userWHM_passWHM_svIP);
            
    $list_main_domains $WHM->uapi->Resellers->list_accounts();

            
    var_dump($list_main_domains['data']);

    ?>
    But always it return this:
    D:\xampp\WHMEmailManager\api_test.php:10:null


    Why happend this? (We are trying using the "root" account)

    And this is my script (in Spanish): github.com/KuroiNekoWitch/WHMEmailManager
     
    #1 KuroiNekoDev, Aug 8, 2018
    Last edited by a moderator: Aug 8, 2018
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,531
    Likes Received:
    1,965
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice