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!

[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:
    151
    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:
    151
    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:
    166
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. UrlGuy

    UrlGuy Member

    Joined:
    Dec 12, 2005
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    151
    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

  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