我正在使用 REST API 来创建子域,并且工作得很好而且..它的设置方式更清晰..您可能找不到足够的文档,但是如果您尝试一些事情,您会发现它工作得很好..我也认为更快但是这不是重点..所以这就是我安装 SSL、ftp 用户、PHP 版本等的方法。
$new_store = array(
"name" => newstore.sudbomain.com,
"description" => 'New store example',
"hosting_type" => 'virtual',
'hosting_settings' => array(
"www_root" => 'Clients/newstore.sudbomain.com,
'ftp_login' => $this->_ftp_user,
'ftp_password' => $this->_ftp_pass,
'php' => true,
'php_handler_id' => 'plesk-php80-fpm',
'certificate_name'=> 'WildCardSSL'
),
"parent_domain" => array(
"id" => $this->_ng_id,
"name" => $this->_ng_name,
"guid" => $this->_ng_guid
),
"ip_addresses" => ["XXX.XXX.XXX.XXX"],
"ipv4" => ["XXX.XXX.XXX.XXX"],
"ipv6" => ["xxxx:xxx:xxx:xxxx::x"]
);
$body = json_encode($new_store, JSON_UNESCAPED_UNICODE);
$this->api_call('domains', $body, $response, $error);
// 'domains' is the endpoint
// $body is the json
// $response is the returned json response
// $error is errors returned from the curl command