title: Using PHP to Execute cURL to send Push Notification
body: <p>I'm attempting to send a cURL command to send a push notification. I'm pretty new to cURL and cannot seem to get the command to run. </p>
  
  <p>Here is the cURL command line:</p>
  
  <pre><code>curl --header "Authorization: key=AAAAVD27CWY:APA91bE7YdKYiqTmQhErf0E3gm8lbgNt2KP5-xPQf83V7m8eKsa0ljktOLiGyzzrP0uxVNBHC6cyuJAPejkTyNl1DnoxcajesLvGXIzq3YR1l-wiFvoivRmIUkDvThTsKCJkZMomhEPp" --header Content-Type:"application/json" https://android.googleapis.com/gcm/send -d "{\"registration_ids\":[\"fr1l051Pczw:APA91bGkyuA6iKMP6oICJ8NweijQpWTWGuo-inqvpF5-Mety0D7oL_ppvevKKdWPxIo7ev_v5sAWbprk7pEg8kz3cNCivipL9RCR3XlA1caBtahsRtnANZpaU-KYnsdjcGY3Q51xN1ny\"]}"
  </code></pre>
  
  <p>and here is the PHP cURL I'm trying to execute:</p>
  
  <pre><code>$ch = curl_init();
  
  curl_setopt($ch, CURLOPT_URL, "https://android.googleapis.com/gcm/send");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"registration_ids\":[\"fr1l051Pczw:APA91bGkyuA6iKMP6oICJ8NweijQpWTWGuo-inqvpF5-Mety0D7oL_ppvevKKdWPxIo7ev_v5sAWbprk7pEg8kz3cNCivipL9RCR3XlA1caBtahsRtnANZpaU-KYnsdjcGY3Q51xN1ny\"]}");
  curl_setopt($ch, CURLOPT_POST, 1);
  
  $headers = array();
  $headers[] = "Authorization: key=AAAAVD27CWY:APA91bE7YdKYiqTmQhErf0E3gm8lbgNt2KP5-xPQf83V7m8eKsa0ljktOLiGyzzrP0uxVNBHC6cyuJAPejkTyNl1DnoxcajesLvGXIzq3YR1l-wiFvoivRmIUkDvThTsKCJkZMomhEPp";
  $headers[] = "Content-Type: \"application/json\"";
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  
  $result = curl_exec($ch);
  if (curl_errno($ch)) {
      echo 'Error:' . curl_error($ch);
  }
  curl_close ($ch);
  </code></pre>
  
  <p>I'm running this with Google's Firebase Cloud Messaging. </p>
  
  <p>I can execute the command on my server, so I know at least that works.</p>
  
  <p>Running UBUNTU 16.04 and Apache.
  I am running SSL on the server and have tried adding:</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  </code></pre>
  
  <p>Still no luck.</p>