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!

WHM Auto script...

Discussion in 'General Discussion' started by *asterisk*, Sep 23, 2005.

  1. *asterisk*

    *asterisk* Member

    Joined:
    Jul 14, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    151
    PHP:
    #!/usr/local/cpanel/3rdparty/bin/php     
    <?php    
    require '/usr/local/cpanel/Cpanel/Accounting.php.inc';  
    $host "localhost";  
    $user "whm login";  
    $accesshash 'whm pass';    
    $accts listaccts($host,$user,$accesshash,0);  
    print_r($accts);  
    $pkgs listpkgs($host,$user,$accesshash,0);  
    print_r($pkgs);  
    ?>
    I have tried the PHP code above which I have found on the cPanel website but after trying it I get only html code in arrays.
     

    Attached Files:

  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    166
    The value being returned to you by this function is indicating an authentication failure.

    You'd need to check that $user is the correct WHM username and that $accesshash contains the correct remote access key and NOT the WHM password.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. *asterisk*

    *asterisk* Member

    Joined:
    Jul 14, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    151
    remote access key is in /usr/local/cpanel/Cpanel/key ?
     
  4. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    166
    In short, no.

    You'd have to get/generate this from WHM > Cluster/Remote Access > Setup Remote Access Key
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. *asterisk*

    *asterisk* Member

    Joined:
    Jul 14, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    151
  6. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    166
    I assume that everything is now working fine?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. *asterisk*

    *asterisk* Member

    Joined:
    Jul 14, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    151
    yeah it works ;)
     
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