Answer the question
In order to leave comments, you need to log in
Why does Vesta always give an error?
Good afternoon
There is a server with vesta on DigitalOcean. I
use the example from the vesta api documentation to create subdomains
$postvars = array(
'user' => $this->vst_username,
'password' => $this->vst_password,
'returncode' => $this->vst_returncode,
'cmd' => 'v-add-domain',
'arg1' => $this->username,
'arg2' => $this->session->adding_domain // domain
);
$postdata = http_build_query($postvars);
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://' . $this->vst_hostname . ':8083/api/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
$answer = curl_exec($curl);
if($answer == 0) {
echo "Domain has been successfuly created\n";
} else {
echo "Query returned error code: " .$answer. "\n";
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question