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.

[PHP] Create Accounts

Discussion in 'General Discussion' started by UrlGuy, Dec 12, 2005.

  1. UrlGuy

    UrlGuy Member

    Joined:
    Dec 12, 2005
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I'm new to this and this thing about making cPanel accounts with a PHP script sounds very interesting. Although I coulnd't completely understand how to do this from the documentation.. $accesshash is that the long thing that you can generate from WHM?
    $ssl is that supposed to be 1 or 0?

    Can anyone give me a short snippet to show me how I can make a cPanel account using PHP?
    I have already made the package 'testpackage' which the script should use to create the account. All replies greatly apprecciated!
    Thanks in advance!

    Best Regards,
    ~urlguy..
     
  2. UrlGuy

    UrlGuy Member

    Joined:
    Dec 12, 2005
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Ok I tried a testscript but it doesnt allow me to include /usr/local/cpanel/Cpanel/Accounting.php.inc for some reason. Heres the error Im getting:

    Warning: main(): open_basedir restriction in effect. File(/usr/local/cpanel/Cpanel/Accounting.php.inc) is not within the allowed path(s): (/home/custom:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/custom/public_html/cp/make.php on line 3

    Warning: main(/usr/local/cpanel/Cpanel/Accounting.php.inc): failed to open stream: Operation not permitted in /home/custom/public_html/cp/make.php on line 3

    Warning: main(): open_basedir restriction in effect. File(/usr/local/cpanel/Cpanel/Accounting.php.inc) is not within the allowed path(s): (/home/custom:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/custom/public_html/cp/make.php on line 3

    Warning: main(/usr/local/cpanel/Cpanel/Accounting.php.inc): failed to open stream: Operation not permitted in /home/custom/public_html/cp/make.php on line 3

    Warning: main(): Failed opening '/usr/local/cpanel/Cpanel/Accounting.php.inc' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/custom/public_html/cp/make.php on line 3

    Fatal error: Call to undefined function: createacct() in /home/custom/public_html/cp/make.php on line 12
     
  3. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    Unless you have root access, you'll need to have your host resolve this. If you have root access you can go to root WHM and de-select open_basedir restriction OR copy the file to your account folder.
     
  4. UrlGuy

    UrlGuy Member

    Joined:
    Dec 12, 2005
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Okay, thanks. I'll ask my host for that file then, since they probably wont do any changes for me in the filesystem :rolleyes:
    thx for your reply :D
     
Loading...

Share This Page