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.

whm php api: createacct error

Discussion in 'General Discussion' started by svbeek, Jul 28, 2004.

  1. svbeek

    svbeek Registered

    Joined:
    Jul 28, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Netherlands
    When i try to create a user using the php api createacct function i get the following error:

    And the account isnt created. I couldnt find a proper solution on these forums nor google, so i hope anyone can help me out. I'm convinced my paramters are correct, since listing users etc. works great. Is this a bug in the scripts?

    My code:

    Disabling ssl doenst make any difference..
     
  2. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    Try using variables rather than plain text for all entries. Is your Accounting file in the same directory as your script?
     
  3. svbeek

    svbeek Registered

    Joined:
    Jul 28, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Netherlands
    This is just a test, thats why i have those hardcoded values. And yes, it is. I'm sure the call is made.. you could make that up out of my post, please give me answers that are of use to me.
     
  4. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    The variables are not being passed or you've not posted a complete "Results of your request". Furthermore "require("accounting.inc.php");", is incorrect. If you made a copy of the Accounting.inc.php and moved it to web accessible directory, that may be your problem. Start with the basics, use the original file, and the original variables and work you way towards the modifications.
     
  5. svbeek

    svbeek Registered

    Joined:
    Jul 28, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Netherlands
    Ok, one line of the output is missing indeed, here's the full output:

    But i still havn't made any progress.. And why should require() be incorrect ? Using include() doesnt make any difference in the result.
     
  6. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    A few points.
    1. Change the domain your trying to use to something that doesn't begin with test.
    2. Use localhost, unless your attempting to create an account on a remote host. If you are, load the script on you're cpanel server and try it from there first.
    3. Ensure that the plan exists.
    4. Try the above script on your server and see if it works.
     
  7. svbeek

    svbeek Registered

    Joined:
    Jul 28, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Netherlands
    I found what the problem was. I got the accounting.php.inc file from someone who downloaded it with IE. Somewhere in that process the & characters in the file got replaced by &, so the url's in the cpanel funtions got screwed up. Pretty stupid, i know.
    Thanks for trying to help me.
     
  8. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    Sorry I should have been more direct, I kind of beat around the bush. The best way to verify the script is loading the script on the server that your creating the accounts on and using the original Accounting.inc.php file and work your way from there. Of course if everything is right to start, the script should work on a remote server. Glad to hear it's working. Take care.
     
Loading...

Share This Page