Error use "v-add-letsencrypt-domain" on my server
Posted: Wed Mar 27, 2019 4:07 am
On my localhost, every ok (return 0 - success).
On centos server, I can't add letsencrypt with curl, return like the image
My script
Error image
Please help me, thank you!
On centos server, I can't add letsencrypt with curl, return like the image
My script
Code: Select all
<?php
// Server credentials
$vst_hostname = 'xxxxxxx';
$vst_username = 'xx';
$vst_password = 'xx';
$vst_returncode = 'yes';
$vst_command = 'v-add-letsencrypt-domain';
// Prepare POST query
$postvars = array(
'user' => $vst_username,
'password' => $vst_password,
'returncode' => $vst_returncode,
'cmd' => $vst_command,
'arg1' => $vst_username,
'arg2' => 'phanhuuhien.aztest.vn'
);
$postdata = http_build_query($postvars);
// Send POST query via cURL
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://' . $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);
$return = curl_exec($curl);
// Check result
if($return == 0) {
echo "ok";
} else {
echo "no ok";
}
?>
Please help me, thank you!