automated cPanel creation and access

skyfe

Registered
Mar 19, 2011
3
0
51
Hi there,

What I would like to do is creating cPanel accounts automaticly through my PHP script and automaticly create a database user and database to the just created cPanel account + upload files to it automaticly. Though I have no idea how to do this, could anyone help me out a little? Is there any examples or something to do this?

Thanks in advanced.

Best Regards,
Skyfe.
 

skyfe

Registered
Mar 19, 2011
3
0
51
I've had a look into that document already but I did not find any way in PHP to create e.g. database for an account or dynamicly add files 'to an account' using PHP.
 

cPanelDavidN

Well-Known Member
Staff member
Dec 17, 2009
571
3
68
Houston, TX
cPanel Access Level
Root Administrator
Hi Skyfe,

I'd suggest taking a look at this blog article, Frequently Asked Scripts: "How do I automate XYZ after creating an account?" - cPanel Integration . It's primarily geared towards someone who wants to create a postwwwacct script hook. However, there should be plenty of fuel there to get you going since there are many ways that you could automate account creation and other account related actions (like database creation). The XML-API PHP client class will make scripting those calls pretty straight forward (as illustrated in that blog article and in many threads here in the Developer Discussion forum).

Calls your going to be interested in are:
1) XML-API createacct
2) API1 Mysql module
3) I'll probably use the native PHP ftp or system commands for placing the files you want, as opposed to our API1 Fileman module (which would require you to POST a multi-part HTTP request)

Let us know if you need anything else!

Regards,
-DavidN