zubrag.com
Free php and cpanel scripts to automate your daily routine

Free PHP Scripts :: cPanel Subdomains Creator

Use cPanel Subdomain Creator to create subdomains on cPanel based hosting.

Input:
  • cPanel account username
  • cPanel account password
  • cPanel skin (see Determining your cPanel Theme/Skin for more info on how to determine cPanel skin)
  • list of subdomains to be created in the plain text file (if creating from file)
  • Parent domain (can create subdomains for different domains when creating from file)

Update program header with above settings and script is ready to use.

Usage: (you can use this script in either way)
  • Open script in browser and fill the form data
  • Pass all information via URL (form will not appear in this case)
    Example: cpanel_subdomains.php?cpaneluser=USER&cpanelpass=PASSWORD&domain=DOMAIN&subdomain=SUBDOMAIN
  • List all subdomains to be created in the plain text file

Note: If script cannot find file with subdomains and no parameters passed via URL then it will show input form.

Download cPanel Subdomains Creator


Comments

July 13, 2006
I wish I could find it earlier :( Payed $10 for such script recently.
August 1, 2006
can u please make another version that allow me to write the domain name and the user name in a form and then the account is created ??
zubrag August 1, 2006
Now it can handle three ways: input form, parameters via URL, or subdomains list from file.
August 3, 2006
There's no option for which plan to use?
What does this default to when there are several plans available for one domain?
I wouldn't want subdomains to have the same quotas and features as the main account. eg: unlimited, if I'm setting up member subdomains.

zubrag: It just creates subdomains with same quotas and features as the main account. We are going to develop the cPanel WHM User Accounts Creator soon for those who need automatical user accounts set up (mostly hosting resellers). It will be separate script, since it will require access to cPanel Web Host Manager.
Cookie August 9, 2006
I like this script alot but it would be handy if it created a ftp account as well.
zubrag August 9, 2006
Cookie, we are going to implement adding FTP account. Please check back in few days.
August 14, 2006
When you create Cpanel subdomains through WHM, You must choose the package it will be assigned. Otherwise, the subdomain will have the same privelledges and quotas as the parent account.
This is NOT something you want if you are a reseller or if you are prividing userspace.
In order to protect other users and the main account with suexec, limit shell access, define frontpage extensions on/off, etc, the package should be assigned when creating the subdomain ;)
Otherwise, this script would only be suitable for a single user cpanel account.
August 19, 2006
how i can delete subdomein with this script?
cnielson [anti-spam] cmaiinc.com August 19, 2006
I succeeded on first attempt to create a single sub-domain using form..worked great...

How would I write the browser command to use a list?

This is not clear to me..... I understand I could create a list (in say a txt file--listing the sub-domains..) and then what would be the format of the command ....

Great tool...and thanks for your help..
Charlie Nielson

--

=====
cpanel_subdomains.php?cpaneluser=USER&cpanelpass=PASSWORD&domain=DOMAIN&subdomain=SUBDOMAIN
zubrag August 19, 2006
You cannot delete subdomains with this script. It can only create subdomains.

If you want it to create subdomains from file then:
1. you will need to create file named 'domains.txt' which would contain list of subdomains (one per line).
2. use following command:
cpanel_subdomains.php?cpaneluser=USER&cpanelpass=PASSWORD&domain=DOMAIN
Above DOMAIN is domain for which you want to create subdomains.
santino [anti-spam] uhupi.com September 8, 2006
I find this script great, but the problem I have is that when I create a subdomain it redirects automatic to the folder with the same name, for example, I do www.sub.domain.com i created the subdomain call SUB, and automaticlly create a folder calls SUB and redirect there, how can I do to add also a diferent redirection in the same time the subdomain register.
Thanks
Karl September 16, 2006
Wish is was more secure, so that only select people can run the script.
September 23, 2006
Thanks man! It works perfectly!
Will September 24, 2006
Excellent script, thanks!
lungu_bogdan [anti-spam] yahoo.com September 28, 2006
Good ideea! Worked perfectly. Thanks!
abuhark [anti-spam] gmail.com October 19, 2006
Any give me same for hosting contrller pl
buy cheap domains October 19, 2006
Karl, I did what you want with http://www.zubrag.com/scripts/password-protect.php

You'll get password protected domain creator
Hybrid November 5, 2006
This is looking great!
s.anand1 [anti-spam] gmail.com November 8, 2006
Thanks for this script. It was really awesome of you.

I know only very basic PHP..should I delete any of the "define" lines if I am choosing to take one of the options or can i simply copy the code and work?

I seem to be having some problem here.
raju November 14, 2006
Nice script, I have extended the script once more. Your visitors can signup for their own email accout and you can set quota for each.
Moreover, I converted into a class for greater inconvience.

visit http://www.rajuru.xenexbd.com/
roachd [anti-spam] roachville.com November 15, 2006
You are the man! Great solution. Keep it up.
nakiox [anti-spam] hotmail.com November 18, 2006
Hi! nice Script.. well.. but I need help.. I need to auto create subdomains when a user sign up to my website.. is secure if I send the cpanel user and pasword by hidden variables? .. can some inteligent user get my cpanel user and password ?..
please reply to my email if you can!
Thanks a lot.
sat_verman [anti-spam] rediffmail.com November 28, 2006
Hi! nice Script.. well.. but I need help.. I need to auto create subdomains when a user sign up to my website.. is secure if I send the cpanel user and pasword by hidden variables? .. can some inteligent user get my cpanel user and password ?..
please reply to my email if you can!
Thanks a lot.
mustatin [anti-spam] yahoo.com December 21, 2006
great script man, but can you give us a solution to delete subdomain also?
Johan January 2, 2007
Great script, even for somebody without knowledge of php, it is easy to handle.
Shouldn't it be easy to change a little in the php source code, so that it can automatically delete the subdomains also?
brandonchall [anti-spam] comcast.net January 3, 2007
I need a custom script created. I would like to speak with you about creating it. Of course, I would be willing to pay for your time. Please contact me at the above email address. Thanks.
January 16, 2007
great script! was playing around with rewriterules to try and fake it... just what i was looking for!
wizard_tn [anti-spam] hotmail.com January 16, 2007
I tried running this to enter multiple subdomains from the text file.

1st run: 4 names in file.. quit after 3 creations

2nd run: 44 names in file.. quit after 5 creations.

Does not seem to handle the creation from the .txt file well.

Any suggestions?
Mastermind January 23, 2007
Thanks for the script, this is very useful!
It works perfect...
Jillian January 23, 2007
Thank you so much, I have been tearing my hair out trying to figure out how to do this...
February 13, 2007
hi, when running the script throgh form error comes: Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:2082 in /home/www/a43837f89b961fe6c2f05ce023e384e2/web/cpanel_subdomains.php on line 87
Socket error . Please help
kevindill [anti-spam] yahoo.com February 14, 2007
Hi, does anyone know a script that can remove multiple subdomains? I installed a bunch and they need to be deleted and reinstalled. Thanks for any information.
Bunny February 22, 2007
HTTP/1.0 404 Not Found Server: cpsrvd/10.9.6 Connection: close Content-type: text/html 404 Not Found Not Found The server was not able to find the document (./frontend/x/subdomain/doadddomain.html) you requested Please check the url and try again. You might also want to report this error to your webhost. cpsrvd/10.9.6 Server at localhost


i got above error when i creating subdomain
please help me
February 25, 2007
Set "x2" as cPanel Skin (without ")
hmqasimali201 [anti-spam] yahoo.co.in February 28, 2007
please help sokket error
enjoygame [anti-spam] hotmail.com - http://www.virtualdarpan.com April 28, 2007
thanks its fine in cpanel but i couldn't get success with vdeck. and its nightmare using vdeck for subdomain coz u are told to create unlimited[i mean allowed] but there is no space than 10. it would be great if this script help with vdeck.
Pink May 22, 2007
Can you please explain the process step by step what exactly i have to do after downloading the file , if i want to run and test the creation of sub domain like suman.example.com.
eddie June 1, 2007
Are you interesting to write about redirect system with cpanel subdomain include member system? I agree pay money for it!
my-email is eddie0936031870@gmail.com
xivworker [anti-spam] yahoo.com August 4, 2007
thanks a lot
Qenzoz August 25, 2007
I get Socket error
what shall i enter in Domain: ?
infosgsl [anti-spam] dbzmail.com August 31, 2007
I want a free subdomain hosting to test my website
narenderkota [anti-spam] yahoo.com September 26, 2007
Is this the way of, which the blogger blogspot will create subdomains ?
Sony "mobitrek" AK September 30, 2007
Hi Zubrag, great script, i'm using the script for our subdomain creation at mobitrek.com for our community. Keep the good work!! (Sony AK from Mobitrek Mobile Solutions Indonesia http://m.mobitrek.com)
Glyn October 19, 2007
Instead of creating folder on the root, how about within a subfolder?
for example, testing.domain.com, instead of /public_html/testing, can we have /public_html/folder1/folder2/testing
??

thanks!!
Glyn October 19, 2007
btw, my email is tantaikooi[anti-spam]gmail.com
mattruler [anti-spam] gmail.com November 10, 2007
Hi, is there any way to change the default directory for the subdomain??
acromm [anti-spam] gmail.com November 15, 2007
yes, send the &dir parameter in the URL with,
ex//
public_html/DIR/SUBDIR/ETC...
alongkorn.s [anti-spam] gmail.com December 15, 2007
I 'm very thank you for your scripts, its help me to solve problem about mass domains addon.
Finally that it's success.

http://www.9korn.com/2007/free-script-cpanel-mass-addon-domain/
webmaster [anti-spam] ourwedding.in December 26, 2007
We use your scripts to create subdomain. The hosting services provider has upgraded to ver 11 (cpanel). Your scripts fail now. We were advised to specify the default path when we create the subdomains (these were created in root folder and should have been created in public_html or the www folder).

Let's know how we define the 'path' .

Thanks in advance for your time.
December 28, 2007
This script took down my entire server.
hulkbaba [anti-spam] hulkbaba.com December 29, 2007
Hi, great work but my server gone down too =(
GTXPC December 31, 2007
Code is good, but something needs to be check because after the script it't run makes Server go down something changes in teh httpd file or config, that is not good. has to be a way to fix this. zubrag please check the code. thank you gtxpc
iman.khaghani [anti-spam] gmail.com January 6, 2008
this code cause the server to be down. i tried this code on payamtejarat.net which cause their apache server to be down two times and they suspend my account. my hosting Cpanel is cpanel 11-X3 zubrag it is very necessary to fix the bug or give a solution for it
January 11, 2008
Hi
Server getting down. Actually sth wrong with apache.
Also as soon as subdomain is created, the folder is also being created. But, there is a funny sign at the end of the folder.

Dan January 14, 2008
This crashed 2 different servers. It kills the httpd server process. We tried this on both of our servers with the same results. Strange since about 3 months ago this worked fine on our server and now it crashes it every time? Any fix yet?
January 22, 2008
Brandon

I'm a newbie on this stuff. What is a subdomain?
January 22, 2008
waiting to fix bug then download, otherwise...

www.web2view.com
= zubrag = January 23, 2008
Hello!
Looks like subdomains create process has been changed in cPanel 11. This forum thread has info on how to fix if you are on cPanel 11. Meanwhile i'm trying to automate the process somehow. Please do not post your questions here, post them on the forum. Thank you!

http://www.zubrag.com/forum/index.php/topic,373.msg1479.html#msg1479
Aila January 27, 2008
Sorry for breaking your rule. my internet connection is down at the moment and alot of links that i go to don't work. well, um... i'm kinda knew to adding subs n stuff so yea...

oh, and i filled out the form thing then i pressed create subdomain or something like that, and i got this error.

HTTP/1.0 401 Access Denied Still Working Connection: close Set-Cookie: logintheme=cpanel; path=/ Set-Cookie: cprelogin=no; path=/ Set-Cookie: cpsession=closed; path=/ Server: cpsrvd/11.2.2 Content-type: text/html cPanel® 11 Login Username Password © cPanel, Inc. 2006-2008

please reply when u have the chance. most appreciate it if u can reply on my site.

roar.exofire.net
a!la
developer.suresh [anti-spam] gmail.com April 7, 2008
Hi,

i am try this cpanel sub domain creater script.really good.i got one issue.
i can see all sub domain in cpanel after using this script.

but, sub domain folder not created in FTP.plese help me.
mkomcihael [anti-spam] yahoo.com May 16, 2008
i need the best of the cpanel
Chris May 22, 2008
as for deleting domain this url can be used i think:
http://domain.com:2082/frontend/x3/subdomain/dodeldomain.html?domain=subdomain_domain.com
admin [anti-spam] 2-wap.net June 3, 2008
zubrag in cpanel 11.23 it didnot work even i changed all themes and

$name = 'test';
$server_name = 'mysite.com';
$cpanel_login = 'login';
$cpanel_pass = 'password';
$cpanel_server = 'www.mysite.com';
$dir = 'public_html/' . $name;
/////////////////////////////////



file("http://" . $cpanel_login . ":" . $cpanel_pass . "@" . $cpanel_server . ":2082/frontend/x3/subdomain/doadddomain.html?domain=$name&rootdomain=$server_name&dir=$dir");

i do have vps server if u want check i will give you login if you want make it workable thanks
a June 17, 2008
SSSSSSSSSSSSSSS
June 20, 2008
Found something is adding this charecter to httpd.conf ^M

Still investigating...
melbinsolomon [anti-spam] gmail.com July 29, 2008
I checket it on cPanel 11.23 and it worked.

First in crashed the server, then i modified the code as below
$request = "/frontend/$cpanel_skin/subdomain/doadddomain.html?domain=$subdomain&rootdomain=$rootdomain";
melbinsolomon [anti-spam] gmail.com July 29, 2008
It created the subdomain and subfolders as well
leon_artan [anti-spam] yahoo.com August 18, 2008
can i modify it so i can create addon domain?

create addon domain is almost similar with sub-domain, but i don't know how to modify it so also can create addon domain name.
= zubrag = August 23, 2008
August 29, 2008
Hello!
Looks like subdomains create process has been changed in cPanel 11. This forum thread has info on how to fix if you are on cPanel 11. Meanwhile i'm trying to automate the process somehow. Please do not post your questions here, post them on the forum. Thank you!
tartub [anti-spam] hotmail.com August 30, 2008
انا عندي موقع اشتريته والحينه يوم غيرة الباسورد نسيت الباسورد لاني ما سويت اد له
شو اسوي عشان اقدر ارجعه
neex1233 [anti-spam] aol.com September 11, 2008
Hi. I would really like to know what this script does. It seems useful.
Anil September 26, 2008
You are great providing such a useful scripts
info [anti-spam] classifiedsgoa.com October 16, 2008
Nice Script
sneha_pooja114985 [anti-spam] yahoo.co.in November 2, 2008
I am preparing for BSNL TTA exam please tell me is your practice paper EC vol I & II are helpful for me or not
Gen January 24, 2009
*-*-*
Thanks!
*-*-*
Gamex February 28, 2009
Great tool...and thanks for your help.

http://www.kaleoyun.com
http://www.freegameshero.com
vaibhav.nadgonde1980 [anti-spam] gmail.com March 19, 2009
Hi,
well I was just wondering but can anybody give me some idea that how can I move all the files and folders in my main domain to this newly created sub domain through such a php script.
kurniawanchan [anti-spam] yahoo.com.sg March 24, 2009
hi,

this is a great script. I really needed it for my member site.
The creation of subdomain is successfull but the only problem is that subdomain is cannot be accessed. Please help me...
maleosx [anti-spam] gmail.com April 4, 2009
hello is this script safe for create a multiple hundred thousand of subdomain?
jon April 6, 2009
hi. im on a free host and only allowed 1 sub domain. it is already used but can i with this script make more sub domains?
April 29, 2009
Plz Help this script create sub domain but not create directory with sub domain name in root directory
April 29, 2009
Hello: I tried to create sub domain through this script, sub domain is created successfully. However name of directory created for each sub domain is not valid. There are few more characters being added with in directory name or some time few characters are removed. I did not edited the default script. Just uploaded script in my domain and used that. But I am facing issue with directory name, Any advise? Thanks
flappi282 [anti-spam] yahoo.co.uk June 28, 2009
Do you have to create a folder as well. When i went on File Manager, i got DATA ERROR.
karthik.shanmugam [anti-spam] g-antssoft.com July 8, 2009
Hi,

i am try this cpanel sub domain creater script.really good.i got one issue.
i can see all sub domain in cpanel after using this script.

but, sub domain folder not created in FTP.plese help me.
July 22, 2009
Hi. This is a really pleasant script. Thank you.
August 11, 2009
:( I can't seem to get it to open in a browser.....
derbl001 [anti-spam] Sgfl.org.uk August 24, 2009
How do i create admin user
and
would this allow free sub domains?
writetunji [anti-spam] yahoo.com August 31, 2009
i have a domain (for example, www.go.com) but am puzzled on how to do any of the following with:
1. creating subdomains to external users by filling the form by these users and will be automatically created.
2. creating subdomains after the first subdomains, e.g sub2.sub1.go.com
What are the critical cases i may be having with my host server?
Thanks in anticipation

michel [anti-spam] facilinfor.be September 3, 2009
Hello,

It seems that it is a wonderful script, but... I use it only without file, i.e. via the form. And I encounter the following problem : the subdomain is well created, but the folder that is created contains a carriage return in its file name. So, if I create the subdoamin test of mydomain.com, when I go in it, the navigator displays in the address bar mydomain.com/test%0D/. And of course, it causes some other problems...

Does anybody knows this problem ?

Thanks,

Michel.
michel [anti-spam] facilinfor.be September 3, 2009
I read previous comments : it seems that I am not the only one with this problem !
Mathew September 20, 2009
Did you CHMOD the .php file to 0777 for it to have access and create it?
arunharidas [anti-spam] gmail.com September 27, 2009
heyy my server down for hrs after running this script .. Data center said that the script is messing with core files.
i think the 'dir' parameter is missing with the script.
October 7, 2009
Me too i had to remove the script again from my site. www.brainemple.org
November 27, 2009
ok, so, is it free, and does it have any viruses?
December 19, 2009
mnb
Mir December 24, 2009
This script is pretty old, if you need to do this, just look at the cpanel API.
ketan January 18, 2010
this scipt works its outstanding azaing thankx a lot
burf2000 [anti-spam] gmail.com February 16, 2010
Brilliant script!

Add Comment

!!! Comments posted here will not be answered. If you want to ask a question please post it on the forum.

E-mail or Name: Not required. Email will be protected from spammers

Comment: Please do not post unrelated comments

Anti-spam: Please enter (9ed5f284) into the box