Skip to main content

How to add Addon Domains using Cpanel API or something?

Comments

3 comments

  • roberthayden
    I try to use xmlapi and do: require_once __DIR__ . "/../../utils/xmlapi.php"; $xmlapi = new xmlapi("IP"); $xmlapi->set_port(2082); $xmlapi->password_auth("USER", "PASS"); $xmlapi->set_debug(1); $result = $xmlapi->api2_query("USER", 'AddonDomain', 'addaddondomain', array('dir' => 'customdomain1.com', 'newdomain' => 'domain1.com', 'subdomain' => 'domain1')); var_dump($result);
    but the result is null. There is no error
    0
  • roberthayden
    Solved using: mgufrone/cpanel-php
    0
  • cPanelLauren
    xml-api is indeed deprecated and it's not even listed any longer in the cpapi2 documentation. You need to use one of the supported formats, there is nothing wrong with the API function itself: cPanel API 2 Functions - AddonDomain::addaddondomain - Developer Documentation - cPanel Documentation
    0

Please sign in to leave a comment.