Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

188
Views
cron job on php script having curl request

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).

When cron runs it hits that API multiple times and users get same sms multiple times.

And when I run that url (custom function url) manually in browser then user gets sms only once.

Cron runs one time in a day

Cron code :

5 18 * * * wget -O - https://www.siteurl.com/sms_notifications/seller

Php script :

<?php
 $url="http://api.textlocal.in/send/";
        $ch = curl_init();
        curl_setopt_array($ch, array(
            CURLOPT_URL => $url,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_POST => true,
            CURLOPT_POSTFIELDS => $postData,
        ));
        $output = curl_exec($ch);
        if(curl_errno($ch)) {
            //echo 'error:' . curl_error($ch);
            return false;
        } else {
            curl_close($ch);
          $this->JobsModel->updateSMSNotificationStatus($smsnotificationid,'yes');
            return true;
        }
?>

Is this issue because I have used wget and do I need to switch to curl or php and why.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!