AAPanel-PHP is a library that allows you to interact with your AAPanel account using PHP. It provides a simple and easy-to-use API that you can use to manage your AAPanel account, such as creating and managing users, domains, and websites.
This README file will guide you through the steps on how to use the AAPanel-PHP library.
- You must have an AAPanel account.
- You must have enabled the API in your AAPanel account.
- You must have your API secret key.
- You must know your AAPanel IP address and port.
-
Enable the API in your AAPanel account.
-
Generate a new API secret key.
-
Enter your public IP address in the IP whitelist.
-
Save your changes.
-
Create a new file and paste the following code:
<?php
use mythicalsystems\aapanel\aapanel_api;
$aapanel = new aapanel_api();
$aapanel->key = 'YOUR_API_KEY';
$aapanel->url = 'YOUR_AAPANEL_IP_AND_PORT';
?>
This will be soon published as a composer package
$aapanel->logs();
$aapanel->addSite($domain, $path, $desc, $type_id = 0, $type = 'php', $phpversion = '73', $port = '80', $ftp = null, $ftpusername = null, $ftppassword = null, $sql = null, $userdbase = null, $passdbase = null, $setSsl = 0, $forceSsl = 0);
$aapanel->addSubDomain($subdomain,$maindomain,$iptarget);
$aapanel->deleteSubDomain($subdomain, $mainDomain, $iptarget);
$aapanel->modifySubDomain($subdomain, $mainDomain, $iptarget, $id)
$aapanel->unzip($sourcefilepath,$destinationpath,$password = null);
$aapanel->forceHTTPS($sitename);
$aapanel->applySSL($domain, $id_site);
$aapanel->siteList($limit,$page,$projectType,$search = null);
$aapanel->disableSite($id_site,$domain);
$aapanel->enableSite($id_site,$domain);
$file = complete path
$aapanel->importDbase($file, $dbasename);
$aapanel->safeFileBody($databody,$filepath);