I am trying to create subdomains and databases using PHP in Plesk. I am looking at their API documentation, but I can’t figure out how to do both of these things, so if you could help me, it would be great!
I am trying to create subdomains and databases using PHP in Plesk. I am looking at their API documentation, but I can’t figure out how to do both of these things, so if you could help me, it would be great!
2
Answers
a little bit later. To create a subdomain:
The database I usually create directly to MySQL with CREATE DATABASE.
There is no able to create database for subdomain, only for domain/subscription.
Here the API request:
where webspace-id – it’a id of domain(not a subdomain) of your subdomain.
If you try to create db on subdomain, you will receive following response:
So, first of all you need to get info about parent domain of subdomain:
Then get id of parent:
Then create database on parent using received id.