I'm trying to do a curl to send a message Whatsapp using PHP in my ubuntu server, i already installed php5-curl (see image bellow) but still get Error : 500 on browser. But if i run on xampp on windows its running well. Is the any missconfiguration in my ubuntu server? thank you for kindly help.
this is php code :
<?php
$curl = curl_init();
$token = "xxxxxxxxxx";
$data = [
'phone' => 'xxxxxxxxxxx',
'message' => 'hellow world',
];
curl_setopt($curl, CURLOPT_HTTPHEADER,
array(
"Authorization: $token",
)
);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($curl, CURLOPT_URL, "https://domain/api/send-message");
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($curl);
curl_close($curl);
echo "<pre>";
print_r($result);
?>
PHP Info
