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!

0 Sorry that username (Account-Name) is taken. Check /etc/passwd

Discussion in 'General Discussion' started by spicerje, May 16, 2008.

  1. spicerje

    spicerje Registered

    May 16, 2008
    Likes Received:
    Trophy Points:
    The following function works, but it gives an error. It looks like it creates the account and then checks to see if it exists and then throws an error because the account it just created already exists?

    The account and user are created. It appears that the function returns without an error, but when I print the status it displays the error.

    0 Sorry that username (Account-Name) is taken. Check /etc/passwd

    function createacct2 ($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctemail,$acctplan) {
    $result = whmreq("/scripts/wwwacct?remote=1&nohtml=1&contactemail=${acctemail}&username=${acctuser}&password=${acctpass}&domain=${acctdomain}&plan=${acctplan}",$host,$user,$accesshash,$usessl);
    if ($cpanelaccterr != "") { return; }
    return $result;
    ---------the call to the function------------------
    $status = createacct2 ($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctemail,$acctplan);
    if ($status)


    I do not have direct access to /usr/local/cpanel so I am unable to modify or view any of the scripts located here. I just have a reseller account and my hosting company does not grant this access.

    Also the API being discussed here will most likely not work for me I want to automate a solution so that the account is created by the end user. Since it appears that the API requires the whm login this will not work. If there is a way to automate the API like the so that a normal user can execute the API call that would be ok. Just remember I have very limited access with my reseller account. Go figure. I know once
    I move to a dedicate or vm server I will get more access. I just can not justify the cost yet
    while I am still learning.


  2. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Dec 28, 2001
    Likes Received:
    Trophy Points:

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