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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Requirements of listaccts/createacct?

Discussion in 'General Discussion' started by Gilles, Mar 9, 2008.

  1. Gilles

    Gilles Registered

    Feb 22, 2008
    Likes Received:
    Trophy Points:
    I have a problem getting listaccts to work.
    I have searched for a solution for days, but can't find the answer anywhere, so I really hope somebody can help me out.

    My situation:
    I work for a company that has several servers, all with WHM/cPanel installed.
    On one server (let's call it "A") I have a database containing account information (URL's, user names, passwords, content, etc. etc).
    Using this database I need to automatically check existing accounts, and create new accounts on the remaining servers (let's call them "B", "C", and "D")
    I was planning to write a PHP script with calls to "listaccts" and "createacct" to accomplish this.

    I have a simple test script to see if listaccts works.
    This is what it looks like:

    require '/usr/local/cpanel/Cpanel/';
    $host = "12.345.678.90"; // IP address of server "C".
    $user = "root";
    $accesshash='7f69fd54135c(.......)69fde1'; // Hash key of server "C".
    $accts = listaccts($host,$user,$accesshash,0);

    The problem:
    The script works fine on server "B" (ie: "B" can access "C").
    But when I try the same script from server "A" my browser "loads" for aprox. 90 seconds and then returns a blank page (no errors, just an empty page).
    I've also tried to connect the other servers from "A", but none work except "localhost" (ie: "A" can access "A", but not "B", "C" and "D").

    I've read I need cURL installed for this to work.
    I checked and I do have cURL installed on all servers.

    My question:
    1) Is there any other requirements I've missed?

    2) the software on server "A" is quite outdated, because my boss is paranoid about updating (it's also running our ad-server, and if it goes down even for one day it will cost his company thousands of dollars)
    curl_version() returned "libcurl/7.15.3 OpenSSL/0.9.7a zlib/ libidn/0.5.6"
    And cPanel says I'm using PHP version "4.4.7" and cPanel build "11.18.2-RELEASE 21613"
    Could this be the cause of my problem? - what are the exact requirements (version numbers) for listaccts?

    3) If this fails, does does anyone know a different way of achieving the same?
    Preferable in PHP, because that's what I know and love.

    Thanks in advance,
  2. robocrop

    robocrop Member

    Mar 19, 2008
    Likes Received:
    Trophy Points:
    Hi Gilles, did you find the problem. By the sound of it I have a similar issue.

Share This Page