I'm trying to send notification to android app by FCM and using curl in my code , the code is working on php5 (on my local xampp) but when I'm trying that on php7.2 (on VPS) this error appears
Undefined variable: curl_setopt in /var/.../sqlite.php on line 305
Fatal error: Uncaught Error: Function name must be a string in /var/.../sqlite.php:305
and here is my code for that part :
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$fcmUrl);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fcmNotification));
$result = curl_exec($ch);
curl_close($ch);
echo $result;
and the Line 305 is
curl_setopt($ch, CURLOPT_URL,$fcmUrl);
anyone know how can I fix this? any help will be much appreciated.