Create Database API – DirectAdmin PHP |

Congrats, You are Subscribed to Receive Updates.

Create Database API – DirectAdmin PHP


Create Database using DirectAdmin PHP API. If you are working with separate VPS and installed DirectAdmin as your cpanel software and you want to create database and user with help of API for further user sales. You need this support to move on. Let’s see the API Functionality to start programming it.

DirectAdmin PHP API Code

include 'httpsocket.php';

$sock = new HTTPSocket;
$sock->connect('',2222); //Your Server IP address


 'action' => 'create',
 'name' => "kvcodestestdb2",
 'user' => "MainUser",
 'passwd' => "Kvcodes@com",
 'passwd2' => "Kvcodes@com",

$result = $sock->fetch_body();
echo $result; ?>

Existing User

If you want to create database with existing user, the array should be like this.

 'action' => 'create',
 'name' => "kvcodestestdb2",
 'userlist' => "MainUser",
 'passwd' => "Kvcodes@com",
 'passwd2' => "Kvcodes@com",

Everytime, when you create database we can create new user for each database.  If you want downloadable code, you can get it here.



About Varadharaj V

The founder of Kvcodes, Varadharaj V is an ERP Analyst and a Web developer specializing in WordPress(WP), WP Theme development, WP Plugin development, Frontaccounting(FA), Sales, Purchases, Inventory, Ledgers, Payroll & HRM, CRM, FA Core Customization, PHP and Data Analyst. Database Management Advance Level

Comment Below

Your email address will not be published. Required fields are marked *


Current ye@r *