Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Jul 2005
    Posts
    8

    Default WHM Auto script...

    PHP Code:
    #!/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 Thumbnails Attached Thumbnails WHM Auto script...-listscreen.jpg  

  2. #2
    Member
    Join Date
    Jan 2005
    Posts
    1,880

    Default

    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.

  3. #3
    Member
    Join Date
    Jul 2005
    Posts
    8

    Default

    remote access key is in /usr/local/cpanel/Cpanel/key ?

  4. #4
    Member
    Join Date
    Jan 2005
    Posts
    1,880

    Default

    Quote Originally Posted by *asterisk*
    remote access key is in /usr/local/cpanel/Cpanel/key ?
    In short, no.

    You'd have to get/generate this from WHM > Cluster/Remote Access > Setup Remote Access Key

  5. #5
    Member
    Join Date
    Jul 2005
    Posts
    8

    Default

    Thank you

  6. #6
    Member
    Join Date
    Jan 2005
    Posts
    1,880

    Default

    Quote Originally Posted by *asterisk*
    Thank you
    I assume that everything is now working fine?

  7. #7
    Member
    Join Date
    Jul 2005
    Posts
    8

    Default

    yeah it works

Similar Threads & Tags
Similar threads

  1. WHM Auto Script
    By MeGaMASTER in forum cPanel and WHM Discussions
    Replies: 12
    Last Post: 11-30-2009, 03:27 AM
  2. recursive folders /usr/local/cpanel/perl/auto/auto/auto/auto...
    By bigste in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-15-2009, 12:52 AM
  3. Auto Backup Script
    By CJL in forum cPanel Developers
    Replies: 6
    Last Post: 07-03-2009, 01:30 AM
  4. Help! I need script for Auto Backup for SQL
    By jeepj27 in forum Database Discussions
    Replies: 1
    Last Post: 09-12-2006, 07:45 PM
  5. Auto Restart Script
    By Netsender in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-07-2004, 01:18 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube