Archive

Archive for the ‘tips & tricks’ Category

How to create subdomain automatically….

October 11, 2009 Leave a comment

The easiest and most reliable way of doing this would be to use the XML API over port 2082 (port 2083 if using SSL).
The actual function for creating a subdomain in cPanel is an API1 function:

domain = subdomain to create

rootdomain = the domain under which to create the subdomain

dir = path beginning at the user’s home directory where pages for this subdomain will be stored

So if I wanted to create the subdomain something.example.com that points to ~/subdomains/something, I would have:

As for translating this all into PHP, PHP 5 class in the developer section of the cPanel Community Forums is

vailable for download to handle all of that for you.

Categories: tips & tricks
Follow

Get every new post delivered to your Inbox.