Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

194
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda