Why my curl request never stop?
===

I wanna get 2 years of data while execute php files.
But the problem is, curl request never stop for one occurence, end if i put that :

    curl_setopt($ch, CURLOPT_TIMEOUT, 30);

It's work but i wait 30sec, in my navigator, i wait few sec for execute the file, why my script never stop?

The code  : 

    <?php
      $dateDeb = '2010-07-23';
      $dateFin = '2012-07-23';
      
      $debut_mois = 07;
      $debut_jour = 23;
      $debut_annee = 2010;
      $fin_mois = 07;
      $fin_jour = 23;
      $fin_annee = 2012;
    $dates=array();
       $debut_date = mktime(0, 0, 0, $debut_mois, $debut_jour, $debut_annee);
       $fin_date = mktime(0, 0, 0, $fin_mois, $fin_jour, $fin_annee);
    
        for($i = $debut_date; $i <= $fin_date; $i+=86400)
        {
                $dates[]=date("Y-m-d",$i);
        }
    
    
      
    foreach($dates as $date){
    
        $cron1='http://ndd.com/admin/api/xiti/bot-lien_sponsorisees/'.$date;
        $cron2='http://ndd.com/admin/api/xiti/bot-affiliation/'.$date;
        $cron3='http://ndd.com/admin/api/xiti/bot-analytics/'.$date;
        
        echo $date." : EN COURS ... ";
        
        $ch = curl_init(); 
        curl_setopt($ch, CURLOPT_URL, $cron1); 
        curl_setopt($ch, CURLOPT_USERPWD, 'user:pass');
       // curl_setopt($ch, CURLOPT_TIMEOUT, 30);
        curl_exec($ch); 
        curl_close($ch);
        
        
        $ch = curl_init(); 
        curl_setopt($ch, CURLOPT_URL, $cron2); 
        curl_setopt($ch, CURLOPT_USERPWD, 'user:pass');
        //curl_setopt($ch, CURLOPT_TIMEOUT, 30);
        curl_exec($ch); 
        curl_close($ch);
        
        echo $date." : OK \n";
        
        }