这是我通过cpanel API创建子域时遇到的错误 https://imgur.com/a/Yhpkh
请帮助。
答案 0 :(得分:0)
请检查下面的链接,它可能会提供您正在寻找的答案: https://forums.cpanel.net/threads/add-subdomain-using-api.119609/
答案 1 :(得分:0)
要通过cpanel API创建子域,您可以尝试以下代码: -
require_once 'xmlapi.php';
$api2args = array(
'domain' => 'subdomain', // name of the subdomain to be created
'rootdomain' => 'example.com', // main domain under which sub
domain needs to be created
'dir' => '/public_html/directory_name', // directory to generate
for this subdomain
'disallowdot' => '1'
);
$result = $xmlapi->api2_query($cpanel['username'], 'SubDomain',
'addsubdomain', $api2args);