title: cron job on php script having curl request
body: <p>I am using an api (for sending sms) for which I am using curl request in my custom function in a controller. we are calling this api using cron job by calling custom function (I am using currently wget for this).</p>
  
  <p>When cron runs it hits that API multiple times and users get same sms multiple times.</p>
  
  <p>And when I run that url (custom function url) manually in browser then user gets sms only once.</p>
  
  <p>Cron runs one time in a day</p>
  
  <p>Cron code :</p>
  
  <pre><code>5 18 * * * wget -O - https://www.siteurl.com/sms_notifications/seller
  </code></pre>
  
  <p>Php script :</p>
  
  <pre><code>&lt;?php
   $url="http://api.textlocal.in/send/";
          $ch = curl_init();
          curl_setopt_array($ch, array(
              CURLOPT_URL =&gt; $url,
              CURLOPT_RETURNTRANSFER =&gt; true,
              CURLOPT_POST =&gt; true,
              CURLOPT_POSTFIELDS =&gt; $postData,
          ));
          $output = curl_exec($ch);
          if(curl_errno($ch)) {
              //echo 'error:' . curl_error($ch);
              return false;
          } else {
              curl_close($ch);
            $this-&gt;JobsModel-&gt;updateSMSNotificationStatus($smsnotificationid,'yes');
              return true;
          }
  ?&gt;
  </code></pre>
  
  <p>Is this issue because I have used wget and do I need to switch to curl or php and why.</p>